Check that db_pl_fetch_byquery only gets 1 query result

This commit is contained in:
Julien BLACHE 2009-11-22 12:30:29 +01:00
parent 6a1c01fa15
commit 1a397ca79b
1 changed files with 9 additions and 0 deletions

View File

@ -1644,8 +1644,17 @@ db_pl_fetch_byquery(char *query)
} }
} }
ret = sqlite3_step(stmt);
sqlite3_finalize(stmt); sqlite3_finalize(stmt);
if (ret != SQLITE_DONE)
{
DPRINTF(E_WARN, L_DB, "Query had more than a single result!\n");
free_pli(pli, 0);
return NULL;
}
/* Playlist 1: all files */ /* Playlist 1: all files */
if (pli->id == 1) if (pli->id == 1)
pli->items = db_files_get_count(); pli->items = db_files_get_count();