Index: res/res_config_sqlite.c =================================================================== --- res/res_config_sqlite.c (revision 333496) +++ res/res_config_sqlite.c (working copy) @@ -1055,7 +1055,7 @@ #define QUERY "SELECT * FROM '%q' WHERE%s %q%s '%q'" /* \endcond */ - query = sqlite_mprintf(QUERY, table, !strcmp(config_table, table) ? " commented = 0 AND" : "", params[0], op, vals[0]); + query = sqlite_mprintf(QUERY, table, (config_table && !strcmp(config_table, table)) ? " commented = 0 AND" : "", params[0], op, vals[0]); if (!query) { ast_log(LOG_WARNING, "Unable to allocate SQL query\n");