From patchwork Fri Oct 26 15:26:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Dooks X-Patchwork-Id: 10657593 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B028D14BD for ; Fri, 26 Oct 2018 15:26:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A685D2C437 for ; Fri, 26 Oct 2018 15:26:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 978FF2C968; Fri, 26 Oct 2018 15:26:36 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 4BDB62C968 for ; Fri, 26 Oct 2018 15:26:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726113AbeJ0AED (ORCPT ); Fri, 26 Oct 2018 20:04:03 -0400 Received: from imap1.codethink.co.uk ([176.9.8.82]:58294 "EHLO imap1.codethink.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726195AbeJ0AED (ORCPT ); Fri, 26 Oct 2018 20:04:03 -0400 Received: from [148.252.241.226] (helo=rainbowdash) by imap1.codethink.co.uk with esmtpsa (Exim 4.84_2 #1 (Debian)) id 1gG40Q-0007d3-3V; Fri, 26 Oct 2018 16:26:34 +0100 Received: from ben by rainbowdash with local (Exim 4.91) (envelope-from ) id 1gG40P-0007vN-NE; Fri, 26 Oct 2018 16:26:33 +0100 From: Ben Dooks To: linux-sparse@vger.kernel.org Cc: Ben Dooks Subject: [PATCH 2/3] tokenize: check if string is not NULL Date: Fri, 26 Oct 2018 16:26:31 +0100 Message-Id: <20181026152632.30318-3-ben.dooks@codethink.co.uk> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181026152632.30318-1-ben.dooks@codethink.co.uk> References: <20181026152632.30318-1-ben.dooks@codethink.co.uk> MIME-Version: 1.0 Sender: linux-sparse-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sparse@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP --- tokenize.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tokenize.c b/tokenize.c index 99b9580..c32f8c7 100644 --- a/tokenize.c +++ b/tokenize.c @@ -124,7 +124,7 @@ const char *show_string(const struct string *string) char *ptr; int i; - if (!string->length) + if (!string || !string->length) return ""; ptr = buffer; *ptr++ = '"';