From 844c34303ed330cbedab05a1bbe0b0337940b6e9 Mon Sep 17 00:00:00 2001 From: merlokk <807634+merlokk@users.noreply.github.com> Date: Wed, 20 Feb 2019 15:18:35 +0200 Subject: [PATCH] fix rare bug in tlv.c --- 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; }