[pkg-opensc-commit] [opensc] 64/295: Don't free file if pointer is null (#858)
Eric Dorland
eric at moszumanska.debian.org
Sat Jun 24 21:11:16 UTC 2017
This is an automated email from the git hooks/post-receive script.
eric pushed a commit to branch master
in repository opensc.
commit f64c71da28d1c1401445f6e8fa45bc079d5b6cd9
Author: Ian Young <ian at iay.org.uk>
Date: Sat Aug 27 22:14:04 2016 +0100
Don't free file if pointer is null (#858)
Protect against segmentation
closes #854.
---
src/libopensc/card-entersafe.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/libopensc/card-entersafe.c b/src/libopensc/card-entersafe.c
index 06becd9..7311e5d 100755
--- a/src/libopensc/card-entersafe.c
+++ b/src/libopensc/card-entersafe.c
@@ -493,7 +493,7 @@ static int entersafe_select_fid(sc_card_t *card,
path.len=2;
r = iso_ops->select_file(card,&path,&file);
- if(r) sc_file_free(file);
+ if(r && file) sc_file_free(file);
SC_TEST_RET(card->ctx, SC_LOG_DEBUG_NORMAL, r, "APDU transmit failed");
/* update cache */
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-opensc/opensc.git
More information about the pkg-opensc-commit
mailing list