From patchwork Fri Oct 17 19:47:37 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Holmes X-Patchwork-Id: 38996 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f198.google.com (mail-wi0-f198.google.com [209.85.212.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 8E1052054E for ; Fri, 17 Oct 2014 19:48:04 +0000 (UTC) Received: by mail-wi0-f198.google.com with SMTP id hi2sf924956wib.5 for ; Fri, 17 Oct 2014 12:48:03 -0700 (PDT) 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:errors-to:sender :x-original-sender:x-original-authentication-results:mailing-list :content-type:content-transfer-encoding; bh=VB1CFebLvYxx0xcne94yARrpJ6ylKPz5UEQgBlN6QZQ=; b=Xo6X65acZL0tFPnoGmmm8PTDyTEUdLARVc/8GQvB3BdhtkcCduE3WSVibgvnE77UOS /E5HEl1GsvYCwACZr6EAesdaI4qgl3ipscxujRLxLwQT5ttFCtxWhIT82ClFCISs3HE4 HRZzXi7gF9NNFro+nliS9/FYZ4rGekNLcmfYcjB+SGzUP6Ctiincl5MNizhL8e2JwSgg 2X+oTUJ3pqZnWGD+Wy95Uj7XQiRerRdT9m++1fNYSb61X7Jw2ULfzNAuAOmFgTICmxaS /g5ZC+G9B9UxVkhxVnoqVu5YkvHpJ2iTsxT8lFbWG/+qeDWtEzJJ9iEIuqx22hiqQuEm R2TQ== X-Gm-Message-State: ALoCoQlFfmyAONWV+o21MHtFe4JL/D9XRgJrxZdT4knATZKyHv1k5HmdCwysIpIh3ulWRVb14sdR X-Received: by 10.180.36.176 with SMTP id r16mr163362wij.7.1413575283654; Fri, 17 Oct 2014 12:48:03 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.22.130 with SMTP id d2ls267516laf.32.gmail; Fri, 17 Oct 2014 12:48:03 -0700 (PDT) X-Received: by 10.152.234.199 with SMTP id ug7mr11157154lac.26.1413575283387; Fri, 17 Oct 2014 12:48:03 -0700 (PDT) Received: from mail-la0-f49.google.com (mail-la0-f49.google.com. [209.85.215.49]) by mx.google.com with ESMTPS id o8si3556695lbc.59.2014.10.17.12.48.03 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 17 Oct 2014 12:48:03 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.49 as permitted sender) client-ip=209.85.215.49; Received: by mail-la0-f49.google.com with SMTP id q1so1247049lam.22 for ; Fri, 17 Oct 2014 12:48:03 -0700 (PDT) X-Received: by 10.112.221.197 with SMTP id qg5mr10997525lbc.32.1413575283232; Fri, 17 Oct 2014 12:48:03 -0700 (PDT) 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.84.229 with SMTP id c5csp292919lbz; Fri, 17 Oct 2014 12:48:02 -0700 (PDT) X-Received: by 10.229.28.196 with SMTP id n4mr15423561qcc.14.1413575281902; Fri, 17 Oct 2014 12:48:01 -0700 (PDT) Received: from ip-10-35-177-41.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id d7si4078311qga.43.2014.10.17.12.47.59 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 17 Oct 2014 12:48:01 -0700 (PDT) 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 1XfDVF-0005kI-QW; Fri, 17 Oct 2014 19:47:57 +0000 Received: from mail-qc0-f178.google.com ([209.85.216.178]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1XfDV9-0005kD-CS for lng-odp@lists.linaro.org; Fri, 17 Oct 2014 19:47:51 +0000 Received: by mail-qc0-f178.google.com with SMTP id c9so1141878qcz.23 for ; Fri, 17 Oct 2014 12:47:46 -0700 (PDT) X-Received: by 10.140.98.233 with SMTP id o96mr14813517qge.31.1413575266142; Fri, 17 Oct 2014 12:47:46 -0700 (PDT) Received: from fedora1.holmesfamily.ws ([98.221.136.245]) by mx.google.com with ESMTPSA id v10sm1642253qar.10.2014.10.17.12.47.45 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 17 Oct 2014 12:47:45 -0700 (PDT) From: Mike Holmes To: lng-odp@lists.linaro.org Date: Fri, 17 Oct 2014 15:47:37 -0400 Message-Id: <1413575257-40398-1-git-send-email-mike.holmes@linaro.org> X-Mailer: git-send-email 1.9.1 X-Topics: patch Subject: [lng-odp] [PATCH] odp_packet_socket.c: 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.49 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. Signed-off-by: Mike Holmes --- platform/linux-generic/odp_packet_socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/linux-generic/odp_packet_socket.c b/platform/linux-generic/odp_packet_socket.c index 006d7bd..da9b5a0 100644 --- a/platform/linux-generic/odp_packet_socket.c +++ b/platform/linux-generic/odp_packet_socket.c @@ -219,7 +219,7 @@ int setup_pkt_sock(pkt_sock_t *const pkt_sock, const char *netdev, /* get if index */ memset(ðreq, 0, sizeof(struct ifreq)); - strncpy(ethreq.ifr_name, netdev, IFNAMSIZ); + strncpy(ethreq.ifr_name, netdev, IFNAMSIZ-1); err = ioctl(sockfd, SIOCGIFINDEX, ðreq); if (err != 0) { perror("setup_pkt_sock() - ioctl(SIOCGIFINDEX)");