aboutsummaryrefslogtreecommitdiffstats
path: root/dev-util/nfcutils/files/nfcutils-fix-segfault.patch
diff options
context:
space:
mode:
authorAlexander Sulfrian <alexander@sulfrian.net>2012-06-06 20:37:17 +0200
committerAlexander Sulfrian <alexander@sulfrian.net>2012-06-06 20:37:17 +0200
commit4eee19decc2ca693b1f0c98f913eacda91c93010 (patch)
treedf2b40a0117bb8731cb4332eec01deeb5e7ab750 /dev-util/nfcutils/files/nfcutils-fix-segfault.patch
parentbd4e0540a41a5105103c57433ca72f1e247e0886 (diff)
downloadoverlay-4eee19decc2ca693b1f0c98f913eacda91c93010.tar.gz
overlay-4eee19decc2ca693b1f0c98f913eacda91c93010.tar.xz
overlay-4eee19decc2ca693b1f0c98f913eacda91c93010.zip
dev-util/nfcutils: fix segfault with patch
Diffstat (limited to 'dev-util/nfcutils/files/nfcutils-fix-segfault.patch')
-rw-r--r--dev-util/nfcutils/files/nfcutils-fix-segfault.patch30
1 files changed, 30 insertions, 0 deletions
diff --git a/dev-util/nfcutils/files/nfcutils-fix-segfault.patch b/dev-util/nfcutils/files/nfcutils-fix-segfault.patch
new file mode 100644
index 0000000..91e381c
--- /dev/null
+++ b/dev-util/nfcutils/files/nfcutils-fix-segfault.patch
@@ -0,0 +1,30 @@
+--- src/lsnfc.c (revision 1072)
++++ src/lsnfc.c (working copy)
+@@ -88,7 +88,8 @@
+ };
+ if((res = nfc_initiator_select_passive_target(pnd, nm, nai.abtUid, nai.szUidLen, NULL)) >= 0 ) {
+ nfc_device_set_property_bool (pnd, NP_EASY_FRAMING, false);
+- if ((res = nfc_initiator_transceive_bytes(pnd, abtCmd,sizeof(abtCmd), abtRx, sizeof(abtRx), 0)) >= 0) {
++ szRxLen = sizeof(abtRx);
++ if ((res = nfc_initiator_transceive_bytes(pnd, abtCmd,sizeof(abtCmd), abtRx, &szRxLen, 0)) >= 0) {
+ // AUTH step1 command success, so it's a Ultralight C
+ nfc_device_set_property_bool (pnd, NP_EASY_FRAMING, true);
+ nfc_initiator_deselect_target(pnd);
+@@ -126,12 +127,14 @@
+ .nbr = NBR_106
+ };
+ if((nfcRes = nfc_initiator_select_passive_target(pnd, nm, nai.abtUid, nai.szUidLen, NULL)) >= 0 ) {
+- if ((nfcRes = nfc_initiator_transceive_bytes(pnd, abtCmd, sizeof(abtCmd), abtRx, sizeof(abtRx), 0)) >= 0) {
++ szRxLen = sizeof(abtRx);
++ if ((nfcRes = nfc_initiator_transceive_bytes(pnd, abtCmd, sizeof(abtCmd), abtRx, &szRxLen, 0)) >= 0) {
+ // MIFARE DESFire GetVersion command success, decoding...
+ if( nfcRes == 8 ) { // GetVersion should reply 8 bytes
+ memcpy( abtDESFireVersion, abtRx + 1, 7 );
+ abtCmd[0] = 0xAF; // ask for GetVersion next bytes
+- if ((nfcRes = nfc_initiator_transceive_bytes(pnd, abtCmd, sizeof(abtCmd), abtRx, sizeof(abtRx), 0)) >= 0) {
++ szRxLen = sizeof(abtRx);
++ if ((nfcRes = nfc_initiator_transceive_bytes(pnd, abtCmd, sizeof(abtCmd), abtRx, &szRxLen, 0)) >= 0) {
+ if( nfcRes == 8 ) { // GetVersion should reply 8 bytes
+ memcpy( abtDESFireVersion + 7, abtRx + 1, 7 );
+ res = malloc(16); // We can alloc res: we will be able to provide information
+