diff options
author | Alexander Sulfrian <alexander@sulfrian.net> | 2012-06-06 21:01:00 +0200 |
---|---|---|
committer | Alexander Sulfrian <alexander@sulfrian.net> | 2012-06-06 21:01:00 +0200 |
commit | 6c2240fc6da443624768286ab1b6c29191ce2956 (patch) | |
tree | fa2e33a09e8b3db9fc4e523e2a7e76b6733d0a6c /dev-util/mfoc/files | |
parent | 4eee19decc2ca693b1f0c98f913eacda91c93010 (diff) | |
download | overlay-6c2240fc6da443624768286ab1b6c29191ce2956.tar.gz overlay-6c2240fc6da443624768286ab1b6c29191ce2956.tar.xz overlay-6c2240fc6da443624768286ab1b6c29191ce2956.zip |
dev-util/mfoc: fix segfault
Diffstat (limited to 'dev-util/mfoc/files')
-rw-r--r-- | dev-util/mfoc/files/mfoc-fix-segfault.patch | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/dev-util/mfoc/files/mfoc-fix-segfault.patch b/dev-util/mfoc/files/mfoc-fix-segfault.patch new file mode 100644 index 0000000..ad09e3b --- /dev/null +++ b/dev-util/mfoc/files/mfoc-fix-segfault.patch @@ -0,0 +1,29 @@ +Index: src/mifare.c +=================================================================== +--- src/mifare.c (revision 1071) ++++ src/mifare.c (working copy) +@@ -104,7 +104,8 @@ + } + // Fire the mifare command + int res; +- if ((res = nfc_initiator_transceive_bytes(pnd, abtCmd, 2 + szParamLen, abtRx, sizeof(abtRx), -1)) < 0) { ++ size_t abtRxSize = sizeof(abtRx); ++ if ((res = nfc_initiator_transceive_bytes(pnd, abtCmd, 2 + szParamLen, abtRx, &abtRxSize, -1)) < 0) { + if (res == NFC_ERFTRANS) { + // "Invalid received frame", usual means we are + // authenticated on a sector but the requested MIFARE cmd (read, write) +Index: src/mfoc.c +=================================================================== +--- src/mfoc.c (revision 1071) ++++ src/mfoc.c (working copy) +@@ -690,7 +690,8 @@ + exit (EXIT_FAILURE); + } + +- if (nfc_initiator_transceive_bytes(r.pdi, Auth, 4, Rx, sizeof(Rx), 0) < 0) { ++ RxLen = sizeof(Rx); ++ if (nfc_initiator_transceive_bytes(r.pdi, Auth, 4, Rx, &RxLen, 0) < 0) { + fprintf(stdout, "Error while requesting plain tag-nonce\n"); + exit(EXIT_FAILURE); + } + |