aboutsummaryrefslogtreecommitdiffstats
path: root/dev-util/mfoc
diff options
context:
space:
mode:
Diffstat (limited to 'dev-util/mfoc')
-rw-r--r--dev-util/mfoc/Manifest3
-rw-r--r--dev-util/mfoc/files/mfoc-fix-segfault.patch29
-rw-r--r--dev-util/mfoc/mfoc-9999.ebuild7
3 files changed, 35 insertions, 4 deletions
diff --git a/dev-util/mfoc/Manifest b/dev-util/mfoc/Manifest
index 42e565f..9f96e48 100644
--- a/dev-util/mfoc/Manifest
+++ b/dev-util/mfoc/Manifest
@@ -1,3 +1,4 @@
+AUX mfoc-fix-segfault.patch 1104 RMD160 2494955653bbabd3b4c152f19b17fa4421b71096 SHA1 62497ae871d3e0871615afa4027b7ac6748564bc SHA256 2ddccf4187463bbee1c416cb4902c70fccdd25dc1452a507b6d9574f1ae74ff3
DIST mfoc-0.10.2.tar.gz 112864 RMD160 a74ccdc22f4ead364872bac0beee0564c53f2be2 SHA1 cce1662300eeab303d375f746dd52e515e2f0e99 SHA256 fc38b990bf37b6416949d0a7c6481bdd8a67698cbb4dcae00c0576fd10845cb0
EBUILD mfoc-0.10.2.ebuild 591 RMD160 ba78dc93a7641e2c8b9e8d0f78b7fa32a17d5389 SHA1 a9440ea46f317ccf620eba2f601598eb5429a6ad SHA256 0e4fe4fcf98476584e4769565592e934242d68a126158552ee915744fc998681
-EBUILD mfoc-9999.ebuild 698 RMD160 7975a141849cbc2eabc3007fdd6e8c81348a3d0a SHA1 ef7a852e81a2f495f9e210f3e2d0c643d6153664 SHA256 ae666c3233a0cd4e9053aa1caa34cefd15a35974544c7d832cccac51a327a211
+EBUILD mfoc-9999.ebuild 735 RMD160 49fb61faf9437ad6315ba10240a1e98382ad5b74 SHA1 9247a44718a04eb36d4589165bc60d7e681589ab SHA256 bd5dcc27a823af8d0a18d8b5f614b8ed9f4c16a3eb870359ed5af24d9529d0c0
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);
+ }
+
diff --git a/dev-util/mfoc/mfoc-9999.ebuild b/dev-util/mfoc/mfoc-9999.ebuild
index 79c1a65..ec1861f 100644
--- a/dev-util/mfoc/mfoc-9999.ebuild
+++ b/dev-util/mfoc/mfoc-9999.ebuild
@@ -19,10 +19,11 @@ CDEPEND=">=dev-libs/libnfc-1.5.1"
RDEPEND="${CDEPEND}"
src_prepare() {
- eautoreconf || die "autoreconf failed"
+ epatch "${FILESDIR}/mfoc-fix-segfault.patch"
+ eautoreconf || die "autoreconf failed"
}
src_install() {
- emake DESTDIR="${D}" install || die "Install failed"
- dodoc README ChangeLog AUTHORS NEWS TODO || die
+ emake DESTDIR="${D}" install || die "Install failed"
+ dodoc README ChangeLog AUTHORS NEWS TODO || die
}