[pkg-opensc-commit] [engine-pkcs11] 04/04: fix segfault in new code.

Eric Dorland eric at moszumanska.debian.org
Mon Oct 19 03:11:53 UTC 2015


This is an automated email from the git hooks/post-receive script.

eric pushed a commit to tag engine_pkcs11-0.1.5
in repository engine-pkcs11.

commit 82baf6f046cfd0a96083730d05d9e4b28e227f9d
Author: Andreas Jellinghaus <andreas at ionisiert.de>
Date:   Thu Jul 31 14:40:14 2008 +0000

    fix segfault in new code.
---
 NEWS                | 1 +
 src/engine_pkcs11.c | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/NEWS b/NEWS
index bf4b586..89fdcca 100644
--- a/NEWS
+++ b/NEWS
@@ -6,6 +6,7 @@ New in 0.1.5; 2008-07-31; Andreas Jellinghaus
   windows (using mingw).
 * cleanup pin code, always use MAX_PIN_LENGTH, proper cleanup.
 * new use PKCS11_CTX_init_args (David Smith)
+* fix segfault in init_args code.
 * needs new version of libp11 (0.2.4 or later).
 
 New in 0.1.4; 2007-07-11; Andreas Jellinghaus
diff --git a/src/engine_pkcs11.c b/src/engine_pkcs11.c
index b29ceb7..44da40e 100644
--- a/src/engine_pkcs11.c
+++ b/src/engine_pkcs11.c
@@ -63,7 +63,7 @@ static char *init_args = NULL;
 
 int set_module(const char *modulename)
 {
-	module = strdup(modulename);
+	module = modulename ? strdup(modulename) : NULL;
 	return 1;
 }
 
@@ -145,7 +145,7 @@ static int get_pin(UI_METHOD * ui_method, void *callback_data)
 
 int set_init_args(const char *init_args_orig)
 {
-	init_args = strdup(init_args_orig);
+	init_args = init_args_orig ? strdup(init_args_orig) : NULL;
 	return 1;
 }
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-opensc/engine-pkcs11.git



More information about the pkg-opensc-commit mailing list