X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/4cdd63b245e34b42df42b384009838020d8fad02..ad326d84ade428fdd41ea8e3de7e8705e1db2277:/client/emv/tlv.c?ds=sidebyside

diff --git a/client/emv/tlv.c b/client/emv/tlv.c
index 9722c931..5472c47a 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;
 	}
 
@@ -582,3 +588,9 @@ bool tlv_get_int(const struct tlv *etlv, int *value)
 	}
 	return false;
 }
+
+bool tlvdb_get_uint8(struct tlvdb *tlvRoot, tlv_tag_t tag, uint8_t *value)
+{
+	const struct tlv *tlvelm = tlvdb_get(tlvRoot, tag, NULL); 	
+	return tlv_get_uint8(tlvelm, value);
+}