Merge upstream git commit f64c71da28d1c1401445f6e8fa45bc079d5b6cd9:

Don't free file if pointer is null
Fix a Segmentation fault error
This commit is contained in:
dcoppa 2016-09-01 13:24:19 +00:00
parent be3b4e492c
commit 194ef4ae94
2 changed files with 23 additions and 2 deletions

View File

@ -1,11 +1,11 @@
# $OpenBSD: Makefile,v 1.36 2016/08/25 13:21:26 dcoppa Exp $
# $OpenBSD: Makefile,v 1.37 2016/09/01 13:24:19 dcoppa Exp $
COMMENT= set of libraries and utilities to access smart cards
VERSION= 0.16.0
DISTNAME= OpenSC-${VERSION}
PKGNAME= opensc-${VERSION}
REVISION= 2
REVISION= 3
GH_ACCOUNT= OpenSC
GH_PROJECT= ${GH_ACCOUNT}
GH_TAGNAME= ${VERSION}

View File

@ -0,0 +1,21 @@
$OpenBSD: patch-src_libopensc_card-entersafe_c,v 1.1 2016/09/01 13:24:19 dcoppa Exp $
commit f64c71da28d1c1401445f6e8fa45bc079d5b6cd9
Author: Ian Young <ian@iay.org.uk>
Date: Sat Aug 27 22:14:04 2016 +0100
Don't free file if pointer is null
Protect against segmentation
--- src/libopensc/card-entersafe.c.orig Thu Sep 1 14:57:18 2016
+++ src/libopensc/card-entersafe.c Thu Sep 1 14:58:01 2016
@@ -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 */