SHA256
1
0
forked from pool/kmod
kmod/libkmod-signature-pkcs-7-fix-crash-when-signer-info-.patch
Jan Engelhardt 27cb7c281e Accepting request 593963 from home:michals
- Fix crash when PKCS#7 signer name is not present in signature (bsc#1088244)
   + libkmod-signature-pkcs-7-fix-crash-when-signer-info-.patch

OBS-URL: https://build.opensuse.org/request/show/593963
OBS-URL: https://build.opensuse.org/package/show/Base:System/kmod?expand=0&rev=142
2018-04-10 13:39:57 +00:00

29 lines
957 B
Diff

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