From patchwork Sat Oct 28 17:31:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: William Tu X-Patchwork-Id: 831636 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="gC+9CGxF"; dkim-atps=neutral Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3yPScn3cVlz9t0F for ; Sun, 29 Oct 2017 04:37:45 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 7A6C3AAB; Sat, 28 Oct 2017 17:32:30 +0000 (UTC) X-Original-To: ovs-dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 73C30A88 for ; Sat, 28 Oct 2017 17:32:25 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pg0-f68.google.com (mail-pg0-f68.google.com [74.125.83.68]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 38C7D203 for ; Sat, 28 Oct 2017 17:32:25 +0000 (UTC) Received: by mail-pg0-f68.google.com with SMTP id 15so7736448pgc.12 for ; Sat, 28 Oct 2017 10:32:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references; bh=PmEAQf0xiCZ4rDImq2lnkciCNx0oIEyhNSRuiDVZ6Cc=; b=gC+9CGxFN2ecbtUznuTk4GrBb8cbAuC8B7AmMQ5zNmB14QXFyFMY0Efh8yKyhDjHD4 C1jgWuu1OUCoeuL6ZTPgu+N1+hUbid4btmCPoQwCLwiQjYuwRPUR7y09r1sEa9cmywTM RSUC4licUFqifQv9KvUNtaejD+zT/9/5Mp/W8aFYZKyJdbjjeaHjo4PPdZoL/lv+738h vHrABOlq1bdPTgo2ggfkhyknq9kfcCNLr1rWYmjV/xS8KpXf7yQv9TCMUxhjSMb8cKJx jSSrYmglqcZixDxsameJtQsjYxkGJnNZlk7LwcqxxUHmpKiJeiY0GQZy/ZcweqOHcNlS FBvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=PmEAQf0xiCZ4rDImq2lnkciCNx0oIEyhNSRuiDVZ6Cc=; b=paW/paMGS2WXF+t1N1cSiKuilg5ggJ9UfJGzewCeGmA3wGqEvLuUQ8O63sdn/IK6+O S2uMkr3FZ0WE3Ll+yUsYjJW5FhleUZvF+qL8kCgW9ISZ96dfULtGUCDEzet6k5IahvhP /2GbouH+vNLPkYovX2lARXWVzBBq4ksWjpz6AinnV3e3xwL6LFm2GLqSnTjkwphIl/Xe VbwJ5p1QxBZn14FOrmpWcprcNAMUJYB5h4CuYmZfKZtCSAvE+LE1k3g+Oaa5HMKYRjD1 dTkzOWDY6YGfxmZcbZ500q+VsFYzFVSM8fYonvZG2flPGhAEV6vsYHi5/ytqdNvEHXe7 pAjA== X-Gm-Message-State: AMCzsaU3FOdDCrGwT4YIunqXr3tfauFbyMABiToTiVZXUn0V1k3nDIvg W8gvbI6BTk7K69Ywdf5DYgI485+s X-Google-Smtp-Source: ABhQp+ShUzYiaqcZSKedbR6acmm2WgZR6tjJUk9SKgnouQW366313O6YXeMaPAdJnLswQ1cx31+JpQ== X-Received: by 10.98.214.76 with SMTP id r73mr3894690pfg.261.1509211944669; Sat, 28 Oct 2017 10:32:24 -0700 (PDT) Received: from sc9-mailhost3.vmware.com ([24.5.191.4]) by smtp.gmail.com with ESMTPSA id x1sm18675418pfh.113.2017.10.28.10.32.23 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 28 Oct 2017 10:32:24 -0700 (PDT) From: William Tu To: ovs-dev@openvswitch.org Date: Sat, 28 Oct 2017 10:31:57 -0700 Message-Id: <1509211918-14829-11-git-send-email-u9012063@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1509211918-14829-1-git-send-email-u9012063@gmail.com> References: <1509211918-14829-1-git-send-email-u9012063@gmail.com> X-Spam-Status: No, score=0.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM autolearn=disabled version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Subject: [ovs-dev] [PATCH 10/11] lib: Fix possible null pointer to execvp. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org Clang reports possible null pointer 'argv[0]' to execvp. Fix it by adding ovs_assert check. Signed-off-by: William Tu Acked-by: Mark Michelson --- lib/process.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/process.c b/lib/process.c index 254052f2c27d..0b8f994f9b75 100644 --- a/lib/process.c +++ b/lib/process.c @@ -275,6 +275,7 @@ process_start(char **argv, struct process **pp) close(fd); } xpthread_sigmask(SIG_SETMASK, &prev_mask, NULL); + ovs_assert(argv[0]); execvp(argv[0], argv); fprintf(stderr, "execvp(\"%s\") failed: %s\n", argv[0], ovs_strerror(errno));