From patchwork Mon Dec 15 21:35:06 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Holmes X-Patchwork-Id: 42293 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f199.google.com (mail-lb0-f199.google.com [209.85.217.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E0D2926C6C for ; Mon, 15 Dec 2014 21:36:16 +0000 (UTC) Received: by mail-lb0-f199.google.com with SMTP id u10sf7808274lbd.2 for ; Mon, 15 Dec 2014 13:36:15 -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: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=jcdZNtA5gUml2giDoN6zbQo/RH4vi1znBsUT0oqDB7M=; b=bpXQo/9nzwyK9MrSAazKfXpfDlxZIk/Av+pkot6FwyNSsYy7+U9LteJFmjyw7IISQW QTnTsblt5Ixw1jO/iZVruI10+z05hBk8oFwXI0O/NhbDaYK+sS2up3mA/mRwfRWENPSr PftAhwwFn16TzphUOXUek39980MbE18mFnObPdxhuXh4M/QP99FUkhRuIS+8d1eQlF2m F0MRXobO5bzPVIjfsheHV9EHVSa5drq9MMFKGe3mQdQEDPnRjdMaHp9x7iQI9B4TbRX4 dtN0b5LCwbcm3UlauD61CeiQRx9hmR5NXFsBJ+bsBaIloIucKFsPBUJjj63d92RMBdpZ b3tA== X-Gm-Message-State: ALoCoQkSocf065epnZevmhZGo7Ez16n/2SW6WPoqITD/vwx9XED7S1EDt+/iL17Pz8fozEhW3qDr X-Received: by 10.180.98.165 with SMTP id ej5mr3848915wib.1.1418679375890; Mon, 15 Dec 2014 13:36:15 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.23.71 with SMTP id k7ls243958laf.9.gmail; Mon, 15 Dec 2014 13:36:15 -0800 (PST) X-Received: by 10.112.42.47 with SMTP id k15mr1007741lbl.75.1418679375488; Mon, 15 Dec 2014 13:36:15 -0800 (PST) Received: from mail-lb0-f173.google.com (mail-lb0-f173.google.com. [209.85.217.173]) by mx.google.com with ESMTPS id h2si5196152lbv.49.2014.12.15.13.36.15 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 15 Dec 2014 13:36:15 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.173 as permitted sender) client-ip=209.85.217.173; Received: by mail-lb0-f173.google.com with SMTP id z12so9813859lbi.32 for ; Mon, 15 Dec 2014 13:36:15 -0800 (PST) X-Received: by 10.152.2.74 with SMTP id 10mr31757965las.38.1418679375298; Mon, 15 Dec 2014 13:36:15 -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.142.69 with SMTP id ru5csp847123lbb; Mon, 15 Dec 2014 13:36:14 -0800 (PST) X-Received: by 10.224.46.134 with SMTP id j6mr37290518qaf.74.1418679373777; Mon, 15 Dec 2014 13:36:13 -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 u4si12090425qac.80.2014.12.15.13.36.12 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 15 Dec 2014 13:36:13 -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 1Y0dJK-0004aH-9a; Mon, 15 Dec 2014 21:36:10 +0000 Received: from mail-qc0-f174.google.com ([209.85.216.174]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1Y0dIa-0004Uu-Ck for lng-odp@lists.linaro.org; Mon, 15 Dec 2014 21:35:24 +0000 Received: by mail-qc0-f174.google.com with SMTP id c9so9311886qcz.5 for ; Mon, 15 Dec 2014 13:35:19 -0800 (PST) X-Received: by 10.140.92.215 with SMTP id b81mr58050243qge.5.1418679318752; Mon, 15 Dec 2014 13:35:18 -0800 (PST) Received: from fedora1.holmesfamily.ws ([98.221.136.245]) by mx.google.com with ESMTPSA id e16sm11718154qaa.28.2014.12.15.13.35.18 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 15 Dec 2014 13:35:18 -0800 (PST) From: Mike Holmes To: lng-odp@lists.linaro.org Date: Mon, 15 Dec 2014 16:35:06 -0500 Message-Id: <1418679306-39971-1-git-send-email-mike.holmes@linaro.org> X-Mailer: git-send-email 2.1.0 X-Topics: patch Subject: [lng-odp] [PATCH] odp_packet_io: 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.217.173 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 Termination of the string is not assured unless the string is one char shorter than the buffer. Fixes coverity 83058 Signed-off-by: Mike Holmes --- platform/linux-generic/odp_packet_io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/linux-generic/odp_packet_io.c b/platform/linux-generic/odp_packet_io.c index a03eeb1..7694236 100644 --- a/platform/linux-generic/odp_packet_io.c +++ b/platform/linux-generic/odp_packet_io.c @@ -247,7 +247,7 @@ odp_pktio_t odp_pktio_open(const char *dev, odp_buffer_pool_t pool) return ODP_PKTIO_INVALID; done: - strncpy(pktio_entry->s.name, dev, IFNAMSIZ); + strncpy(pktio_entry->s.name, dev, IFNAMSIZ - 1); unlock_entry_classifier(pktio_entry); return id; }