Browse Source

TT#14008 avoid duplicate bencode dict keys

Multiple untagged monologues can exist at the same time which would lead
to a broken bencode dictionary. Instead use a pseudo label to
distinguish them.

Change-Id: I0f41c42df8ec17c1c4fb5cc6451ea039612e505f
pull/1373/head
Richard Fuchs 4 years ago
parent
commit
6f0439daf3
1 changed files with 7 additions and 1 deletions
  1. +7
    -1
      daemon/call_interfaces.c

+ 7
- 1
daemon/call_interfaces.c View File

@ -1745,7 +1745,13 @@ static void ng_stats_monologue(bencode_item_t *dict, const struct call_monologue
if (!dict)
goto stats;
sub = bencode_dictionary_add_dictionary(dict, ml->tag.s ? : "");
if (ml->tag.len)
sub = bencode_dictionary_add_dictionary(dict, ml->tag.s);
else {
char *buf = bencode_buffer_alloc(dict->buffer, 32);
snprintf(buf, 32, "<untagged %u>", ml->unique_id);
sub = bencode_dictionary_add_dictionary(dict, buf);
}
bencode_dictionary_add_str(sub, "tag", &ml->tag);
if (ml->viabranch.s)


Loading…
Cancel
Save