From patchwork Mon Feb 16 16:43:15 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Holmes X-Patchwork-Id: 44723 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-we0-f199.google.com (mail-we0-f199.google.com [74.125.82.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id C93292154B for ; Mon, 16 Feb 2015 16:44:04 +0000 (UTC) Received: by mail-we0-f199.google.com with SMTP id q59sf20224353wes.2 for ; Mon, 16 Feb 2015 08:44:04 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:subject:precedence:list-id:list-unsubscribe:list-archive :list-post:list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=iGdlrJRS7d06gWqR931rdo61Owc3Oa1Q0Q8NKsTDbcw=; b=EAmXq+6uwNF2F/HoijAjpNpe9YmceCRlibYMzE3jGe1WM6QzCNKm3HW1Ty38lricsx QE3BCGZVmMdRnDSF7D+2DsxGklk7Ohn7DrHm5Ql222yfa0cBvdaClAgogPu/lgypRrZx RI8BcTlsjPzwZPNq4X5n25Ho39vaPzUj3FDaafY2jYvlTKE9EQNnFbv7jn//loG377hc FgbpPX+ipbJX+dcZdyvnwBUFvOXf39pZv9QzOQzv2VQ+DbRKTgFOYxFL5lJ1iTZapgNL MzwraxyengGBB6dLUa5qu/AI53/MkROMugIOIbGYDhkusvrz9HmUI/0BG7Q0jzh2tLCT Kgjw== X-Gm-Message-State: ALoCoQnv1rTLNcnaYplQJv9gTyy7VWJnbPrhnWp4joeDQ+sKM4pJfEXiPUHs6RVwSf8flrb4OAD5 X-Received: by 10.180.94.134 with SMTP id dc6mr2971676wib.2.1424105044015; Mon, 16 Feb 2015 08:44:04 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.5.74 with SMTP id q10ls576890laq.43.gmail; Mon, 16 Feb 2015 08:44:03 -0800 (PST) X-Received: by 10.152.43.193 with SMTP id y1mr24340979lal.35.1424105043853; Mon, 16 Feb 2015 08:44:03 -0800 (PST) Received: from mail-la0-f48.google.com (mail-la0-f48.google.com. [209.85.215.48]) by mx.google.com with ESMTPS id ru4si7750748lbb.178.2015.02.16.08.44.03 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Feb 2015 08:44:03 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.48 as permitted sender) client-ip=209.85.215.48; Received: by labpv20 with SMTP id pv20so30312222lab.8 for ; Mon, 16 Feb 2015 08:44:03 -0800 (PST) X-Received: by 10.152.5.167 with SMTP id t7mr24576565lat.32.1424105043758; Mon, 16 Feb 2015 08:44:03 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.35.133 with SMTP id h5csp1693883lbj; Mon, 16 Feb 2015 08:44:03 -0800 (PST) X-Received: by 10.140.195.195 with SMTP id q186mr861764qha.103.1424105042367; Mon, 16 Feb 2015 08:44:02 -0800 (PST) Received: from ip-10-35-177-41.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id d187si6346288qhc.104.2015.02.16.08.44.00 (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 16 Feb 2015 08:44:02 -0800 (PST) Received-SPF: none (google.com: lng-odp-bounces@lists.linaro.org does not designate permitted sender hosts) client-ip=54.225.227.206; Received: from localhost ([127.0.0.1] helo=ip-10-35-177-41.ec2.internal) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YNOm5-0004B7-Sm; Mon, 16 Feb 2015 16:43:57 +0000 Received: from mail-qa0-f51.google.com ([209.85.216.51]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YNOlw-0004Ak-UK for lng-odp@lists.linaro.org; Mon, 16 Feb 2015 16:43:48 +0000 Received: by mail-qa0-f51.google.com with SMTP id i13so22711318qae.10 for ; Mon, 16 Feb 2015 08:43:43 -0800 (PST) X-Received: by 10.140.144.136 with SMTP id 130mr2175751qhq.55.1424105023726; Mon, 16 Feb 2015 08:43:43 -0800 (PST) Received: from mike-desktop.?.holmesfamily.ws (c-98-221-136-245.hsd1.nj.comcast.net. [98.221.136.245]) by mx.google.com with ESMTPSA id 139sm4071516qhg.45.2015.02.16.08.43.43 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 16 Feb 2015 08:43:43 -0800 (PST) From: Mike Holmes To: lng-odp@lists.linaro.org Date: Mon, 16 Feb 2015 11:43:15 -0500 Message-Id: <1424104995-18327-2-git-send-email-mike.holmes@linaro.org> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1424104995-18327-1-git-send-email-mike.holmes@linaro.org> References: <1424104995-18327-1-git-send-email-mike.holmes@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCH 2/2] validation: system: fix unterminated string X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: lng-odp-bounces@lists.linaro.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: mike.holmes@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.48 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Calling strncpy with a maximum size argument of 128 bytes on destination array "version_string" of size 128 bytes might leave the destination string unterminated. Fixes https://bugs.linaro.org/show_bug.cgi?id=1207 Signed-off-by: Mike Holmes Reviewed-by: Maxim Uvarov --- test/validation/odp_system.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/validation/odp_system.c b/test/validation/odp_system.c index 65f857a..94ee712 100644 --- a/test/validation/odp_system.c +++ b/test/validation/odp_system.c @@ -15,7 +15,8 @@ static void test_odp_version_numbers(void) char version_string[128]; char *s = version_string; - strncpy(version_string, odp_version_api_str(), sizeof(version_string)); + strncpy(version_string, odp_version_api_str(), + sizeof(version_string)-1); while (*s) { if (isdigit(*s) || (strncmp(s, ".", 1) == 0)) {