From 7527c2bdd821ac194ed362f327b5e6b7aef7d1bb Mon Sep 17 00:00:00 2001 From: Oleg Moiseenko <807634+merlokk@users.noreply.github.com> Date: Wed, 20 Feb 2019 19:35:39 +0200 Subject: [PATCH] fix rare bug in tlv.c (#788) --- client/emv/tlv.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/client/emv/tlv.c b/client/emv/tlv.c index 9722c931..05de928e 100644 --- a/client/emv/tlv.c +++ b/client/emv/tlv.c @@ -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; } -- 2.39.5