SHA256
1
0
forked from pool/kmod
kmod/libkmod-signature-pkcs-7-fix-crash-when-signer-info-.patch

29 lines
957 B
Diff
Raw Normal View History

From 22afe9ca4bd26287554f282cbed9a367deb77186 Mon Sep 17 00:00:00 2001
From: Michal Suchanek <msuchanek@suse.de>
Date: Fri, 6 Apr 2018 12:36:41 +0200
Subject: [PATCH] libkmod-signature: pkcs#7: fix crash when signer info is not
present.
Reported-by: Kazuya Saito <saito.kazuya@jp.fujitsu.com>
Signed-off-by: Michal Suchanek <msuchanek@suse.de>
---
libkmod/libkmod-signature.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libkmod/libkmod-signature.c b/libkmod/libkmod-signature.c
index fae074e6dd1d..782e96f69fef 100644
--- a/libkmod/libkmod-signature.c
+++ b/libkmod/libkmod-signature.c
@@ -166,7 +166,7 @@ kmod_module_signature_info_pkcs7(const char *mem,
sig_info->key_id_len = cert->key_id_size;
sig_info->signer = cert->signer;
- sig_info->signer_len = strlen(cert->signer);
+ sig_info->signer_len = cert->signer ? strlen(cert->signer) : 0;
sig_info->algo = NULL;
sig_info->hash_algo = cert->hash_algo;
--
2.13.6