From 915c73bcfc9dcd74997d999529e450216d2633f8 Mon Sep 17 00:00:00 2001 From: merlokk <807634+merlokk@users.noreply.github.com> Date: Wed, 20 Feb 2019 14:48:52 +0200 Subject: [PATCH 1/2] fix possible error --- client/emv/tlv.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/client/emv/tlv.c b/client/emv/tlv.c index 0daedaf47..31b5ea360 100644 --- a/client/emv/tlv.c +++ b/client/emv/tlv.c @@ -353,6 +353,9 @@ struct tlvdb *tlvdb_find_path(struct tlvdb *tlvdb, tlv_tag_t tag[]) { void tlvdb_add(struct tlvdb *tlvdb, struct tlvdb *other) { while (tlvdb->next) { + if (tlvdb->next == other) + return; + tlvdb = tlvdb->next; } From d81478755e23832505af7aeb64dfbc659c432cd7 Mon Sep 17 00:00:00 2001 From: merlokk <807634+merlokk@users.noreply.github.com> Date: Wed, 20 Feb 2019 14:50:17 +0200 Subject: [PATCH 2/2] 2nd fix --- client/emv/tlv.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/client/emv/tlv.c b/client/emv/tlv.c index 31b5ea360..a309d0659 100644 --- a/client/emv/tlv.c +++ b/client/emv/tlv.c @@ -352,6 +352,9 @@ 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;