aboutsummaryrefslogtreecommitdiffstats
path: root/dev-util/nfcutils/files
diff options
context:
space:
mode:
authorAlexander Sulfrian <alexander@sulfrian.net>2012-09-20 03:45:13 +0200
committerAlexander Sulfrian <alexander@sulfrian.net>2012-09-20 03:45:13 +0200
commit6c784961025e2c794d0614c05b0f246df141b5fb (patch)
tree6e501066b3ec49b6648dab8f4f58c5bff1a9a577 /dev-util/nfcutils/files
parentc80a1c9198087e057c9ea5e3e56744ef9b23cab0 (diff)
downloadoverlay-6c784961025e2c794d0614c05b0f246df141b5fb.tar.gz
overlay-6c784961025e2c794d0614c05b0f246df141b5fb.tar.xz
overlay-6c784961025e2c794d0614c05b0f246df141b5fb.zip
dev-util/nfcutils: adjust patch for new version
Diffstat (limited to 'dev-util/nfcutils/files')
-rw-r--r--dev-util/nfcutils/files/nfcutils-fix-segfault.patch40
1 files changed, 28 insertions, 12 deletions
diff --git a/dev-util/nfcutils/files/nfcutils-fix-segfault.patch b/dev-util/nfcutils/files/nfcutils-fix-segfault.patch
index 91e381c..cd1c675 100644
--- a/dev-util/nfcutils/files/nfcutils-fix-segfault.patch
+++ b/dev-util/nfcutils/files/nfcutils-fix-segfault.patch
@@ -1,30 +1,46 @@
--- src/lsnfc.c (revision 1072)
+++ src/lsnfc.c (working copy)
-@@ -88,7 +88,8 @@
+@@ -76,6 +76,7 @@
+ {
+ uint8_t abtCmd[2];
+ uint8_t abtRx[265];
++ size_t szRxLen;
+ int res = 0;
+
+ abtCmd[0] = 0x1A; // MIFARE UltralightC Auth command
+@@ -87,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) {
+ 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) {
++ 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_device_set_property_bool(pnd, NP_EASY_FRAMING, true);
nfc_initiator_deselect_target(pnd);
-@@ -126,12 +127,14 @@
+@@ -115,6 +117,7 @@
+ {
+ uint8_t abtCmd[] = { 0x60 }; // MIFARE DESFire GetVersion command
+ uint8_t abtRx[265];
++ size_t szRxLen;
+ uint8_t abtDESFireVersion[14];
+ char *res = NULL;
+ int nfcRes = 0;
+@@ -124,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_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 );
+ 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 );
+ 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