mirror of
https://github.com/owntone/owntone-server.git
synced 2024-12-27 15:45:56 -05:00
1) Protect against uninitialised fl in daap_sort_build and 2) Don't
add blank items in daap group reply
This commit is contained in:
parent
a4f9920a09
commit
d1a51ef45d
@ -394,6 +394,8 @@ daap_sort_build(struct sort_ctx *ctx, char *str)
|
||||
char fl;
|
||||
|
||||
len = strlen(str);
|
||||
if (len > 0)
|
||||
{
|
||||
ret = u8_normalize(UNINORM_NFD, (uint8_t *)str, len, NULL, &len);
|
||||
if (!ret)
|
||||
{
|
||||
@ -404,6 +406,9 @@ daap_sort_build(struct sort_ctx *ctx, char *str)
|
||||
|
||||
fl = ret[0];
|
||||
free(ret);
|
||||
}
|
||||
else
|
||||
fl = 0;
|
||||
|
||||
if (isascii(fl) && isalpha(fl))
|
||||
{
|
||||
@ -1634,6 +1639,10 @@ daap_reply_groups(struct evhttp_request *req, struct evbuffer *evbuf, char **uri
|
||||
ngrp = 0;
|
||||
while ((ret = db_query_fetch_group(&qp, &dbgri)) == 0)
|
||||
{
|
||||
/* Don't add item if no name (eg blank album name) */
|
||||
if (strlen(dbgri.itemname) == 0)
|
||||
continue;
|
||||
|
||||
ngrp++;
|
||||
|
||||
for (i = 0; i < nmeta; i++)
|
||||
|
Loading…
Reference in New Issue
Block a user