fix rare bug in tlv.c

This commit is contained in:
merlokk 2019-02-20 15:18:35 +02:00
commit 844c34303e

View file

@ -352,7 +352,13 @@ struct tlvdb *tlvdb_find_path(struct tlvdb *tlvdb, tlv_tag_t tag[]) {
void tlvdb_add(struct tlvdb *tlvdb, struct tlvdb *other) void tlvdb_add(struct tlvdb *tlvdb, struct tlvdb *other)
{ {
if (tlvdb == other)
return;
while (tlvdb->next) { while (tlvdb->next) {
if (tlvdb->next == other)
return;
tlvdb = tlvdb->next; tlvdb = tlvdb->next;
} }