summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Guiter <olivier.guiter@linux.intel.com>2013-06-17 16:42:41 +0200
committerSamuel Ortiz <sameo@linux.intel.com>2013-06-18 17:43:08 +0200
commitfb591d64e8790572d7327a5b744b5190ddc86151 (patch)
treecb1eb116e860835e2f3211520dc6f08f300d00b4
parent73a857512736f4638a82f5cec5cb8ad641c9f8ec (diff)
downloadneard-fb591d64e8790572d7327a5b744b5190ddc86151.tar.gz
neard-fb591d64e8790572d7327a5b744b5190ddc86151.tar.bz2
neard-fb591d64e8790572d7327a5b744b5190ddc86151.zip
nfctype4: Fix segmentation fault on invalid access key
If length is < 0, further access to the resp buffer will cause neard to seg fault.
-rw-r--r--plugins/nfctype4.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/nfctype4.c b/plugins/nfctype4.c
index 4798f5e..1f3295b 100644
--- a/plugins/nfctype4.c
+++ b/plugins/nfctype4.c
@@ -531,7 +531,7 @@ static int t4_select_file_by_name_v2(uint8_t *resp, int length, void *data)
DBG("%d", length);
if (length < 0)
- t4_cookie_release(length, cookie);
+ return t4_cookie_release(length, cookie);
/* Check for APDU error - Not found */
if (APDU_STATUS(resp + STATUS_WORD_1) == APDU_NOT_FOUND) {