]> git.zerfleddert.de Git - proxmark3-svn/blobdiff - client/emv/tlv.c
fix rare bug in tlv.c (#788)
[proxmark3-svn] / client / emv / tlv.c
index 9722c9311ec9cd485daab3527c7e9b245781b12b..05de928ebc03c56dc4604f8945b653019acd22dc 100644 (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;
        }
 
Impressum, Datenschutz