fix rare bug in tlv.c (#788)

This commit is contained in:
Oleg Moiseenko 2019-02-20 19:35:39 +02:00 committed by pwpiwi
commit 7527c2bdd8

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)
{
if (tlvdb == other)
return;
while (tlvdb->next) {
if (tlvdb->next == other)
return;
tlvdb = tlvdb->next;
}