From patchwork Fri Jun 8 17:10:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Michal_Such=C3=A1nek?= X-Patchwork-Id: 10454781 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2754E6037F for ; Fri, 8 Jun 2018 17:10:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1F70429502 for ; Fri, 8 Jun 2018 17:10:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1E0222952D; Fri, 8 Jun 2018 17:10:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BE3CE2950C for ; Fri, 8 Jun 2018 17:10:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752349AbeFHRKl (ORCPT ); Fri, 8 Jun 2018 13:10:41 -0400 Received: from mx2.suse.de ([195.135.220.15]:43826 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751898AbeFHRKk (ORCPT ); Fri, 8 Jun 2018 13:10:40 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext-too.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 89141AC4E; Fri, 8 Jun 2018 17:10:39 +0000 (UTC) From: Michal Suchanek To: Yauheni Kaliuta , Lucas De Marchi , linux-modules , Ferry van Steen , David Howells , Michal Suchanek Subject: [PATCH] libkmod-signature: pkcs#7: fix crash when signer info is not present. Date: Fri, 8 Jun 2018 19:10:15 +0200 Message-Id: <20180608171015.2211-1-msuchanek@suse.de> X-Mailer: git-send-email 2.13.6 In-Reply-To: References: Sender: owner-linux-modules@vger.kernel.org Precedence: bulk List-ID: X-Virus-Scanned: ClamAV using ClamSMTP Reported-by: Kazuya Saito Signed-off-by: Michal Suchanek --- 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;