MT#55283 better tolerate flags parsing

Change-Id: I75164ebc7de77b81182c22c2ada6a40e356a089b
pull/2090/head
Richard Fuchs 4 weeks ago
parent c17a48d5e8
commit 14dde79ec6

@ -130,7 +130,7 @@ static void bencode_list_iter(const ng_parser_t *parser, bencode_item_t *list,
str s;
unsigned int idx = 0;
for (bencode_item_t *it = list->child; it; it = it->sibling) {
if (bencode_get_str(it, &s))
if (bencode_get_str(it, &s) && str_callback)
str_callback(&s, idx, arg);
else if (item_callback)
item_callback(parser, it, arg);

@ -182,6 +182,8 @@ static void rtpp_list_iter(const ng_parser_t *parser, rtpp_pos *pos,
if (str_callback)
str_callback(&pos->cur, idx++, arg);
else if (item_callback)
item_callback(parser, pos, arg);
if (end)
break;
goto next;

Loading…
Cancel
Save