[pkg-opensc-commit] [opensc] 10/23: [p15dump] Do not attempt to access NULL pointer

Eric Dorland eric at moszumanska.debian.org
Tue Jul 5 06:01:11 UTC 2016


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

eric pushed a commit to branch master
in repository opensc.

commit e309d0f06f342165b21f26660219bacbb68ffffc
Author: Jakub Jelen <jjelen at redhat.com>
Date:   Tue May 17 14:15:16 2016 +0200

    [p15dump] Do not attempt to access NULL pointer
---
 src/tests/p15dump.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/tests/p15dump.c b/src/tests/p15dump.c
index 24f19fc..e99919f 100644
--- a/src/tests/p15dump.c
+++ b/src/tests/p15dump.c
@@ -66,10 +66,11 @@ static int dump_unusedspace(void)
 
 	if (p15card->file_unusedspace != NULL)
 		path = p15card->file_unusedspace->path;
-	else {
+	else if (p15card->file_app != NULL) {
 		path = p15card->file_app->path;
 		sc_append_path_id(&path, (const u8 *) "\x50\x33", 2);
-	}
+	} else
+		return -1;
 	path.count = -1;
 
 	r = sc_pkcs15_read_file(p15card, &path, &buf, &buf_len);

-- 
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