]> git.zerfleddert.de Git - proxmark3-svn/blobdiff - client/emv/emvcore.c
fix memory overflow in hf mf nested (issue #479)
[proxmark3-svn] / client / emv / emvcore.c
index 9264b11068c4a9b00f73baa2954a0d62c78b5a70..63a69baab82176ac48a68c0667bff163250ae703 100644 (file)
 
 #include "emvcore.h"
 
-static bool print_cb(void *data, const struct tlv *tlv) {
-       emv_tag_dump(tlv, stdout);
-       dump_buffer(tlv->value, tlv->len, stdout);
+static bool print_cb(void *data, const struct tlv *tlv, int level, bool is_leaf) {
+       emv_tag_dump(tlv, stdout, level);
+       if (is_leaf) {
+               dump_buffer(tlv->value, tlv->len, stdout, level);
+       }
 
        return true;
 }
@@ -23,7 +25,7 @@ void TLVPrintFromBuffer(uint8_t *data, int datalen) {
        if (t) {
                PrintAndLog("TLV decoded:");
                
-               tlvdb_visit(t, print_cb, NULL);
+               tlvdb_visit(t, print_cb, NULL, 0);
                tlvdb_free(t);
        } else {
                PrintAndLog("TLV ERROR: Can't parse response as TLV tree.");
Impressum, Datenschutz