diff --git a/src/dmap_common.c b/src/dmap_common.c index 979e0b96..cb091093 100644 --- a/src/dmap_common.c +++ b/src/dmap_common.c @@ -642,6 +642,9 @@ dmap_query_parse_sql(const char *dmap_query) { struct daap_result result; + if (!dmap_query) + return NULL; + DPRINTF(E_SPAM, L_DAAP, "Parse DMAP query input '%s'\n", dmap_query); if (daap_lex_parse(&result, dmap_query) != 0) diff --git a/src/smartpl_query.c b/src/smartpl_query.c index 1f7566c2..b0411d5d 100644 --- a/src/smartpl_query.c +++ b/src/smartpl_query.c @@ -90,6 +90,12 @@ smartpl_query_parse_string(struct smartpl *smartpl, const char *expression) { struct smartpl_result result; + if (!expression) + { + DPRINTF(E_WARN, L_SCAN, "Parse smartpl query input is null\n"); + return -1; + } + DPRINTF(E_SPAM, L_SCAN, "Parse smartpl query input '%s'\n", expression); if (smartpl_lex_parse(&result, expression) != 0) @@ -98,7 +104,7 @@ smartpl_query_parse_string(struct smartpl *smartpl, const char *expression) return -1; } - if (!result.title || !result.where) + if (result.title[0] == '\0' || !result.where) { DPRINTF(E_LOG, L_SCAN, "Missing title or filter when parsing '%s'\n", expression); return -1;