From patchwork Thu Jul 30 15:23:00 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Balasubramanian Manoharan X-Patchwork-Id: 51700 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f198.google.com (mail-lb0-f198.google.com [209.85.217.198]) by patches.linaro.org (Postfix) with ESMTPS id C59DA22DB5 for ; Thu, 30 Jul 2015 15:24:57 +0000 (UTC) Received: by lbcjf8 with SMTP id jf8sf15436311lbc.0 for ; Thu, 30 Jul 2015 08:24:56 -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: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=ij8VXYC4J9Qvm44ZghK0EYN7LX6bgiA0iWFAg9l1qwg=; b=Jrl0AFiRN8KzQnHcqA/4pVU2kcou8u0vO5uJxZZoah5QPvUBVIXhlRmlYZRz948nEw smhQVI4aVielMMWDhdrX0ddyMKRkdTujA3y00dFuclT3mXxccxCEq8ecwm6YRHePH9KV EozpZHQKSSkX/DxzzPbGb+w7gBw6Dih30VxumUaEOvsAUQb05q/zwSyGPMQaZRM98T+R tQ2xuamH8XgNlR5DYoZixZHg/kBphEHQLnsjKjyDW8RUjYCZaD/GnhRgU3tROHtLu3PB ZhqyCPWjiEBkL/xZnOrO5CrUIJ6jgldqdIjg0lYwXxIS734fkTRcGnv2FZGxpFb5FS/o TSEw== X-Gm-Message-State: ALoCoQm5bMvE5GpVoQ7TTsByrPMELtu2YuoGFOs8B9L2XxJov/Bqq2rWC7I77QP0sxGNanJSnb57 X-Received: by 10.152.1.105 with SMTP id 9mr17889706lal.3.1438269896383; Thu, 30 Jul 2015 08:24:56 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.219.4 with SMTP id pk4ls199586lac.90.gmail; Thu, 30 Jul 2015 08:24:56 -0700 (PDT) X-Received: by 10.112.166.2 with SMTP id zc2mr44815239lbb.29.1438269896233; Thu, 30 Jul 2015 08:24:56 -0700 (PDT) Received: from mail-la0-f41.google.com (mail-la0-f41.google.com. [209.85.215.41]) by mx.google.com with ESMTPS id b4si1101008lbq.1.2015.07.30.08.24.56 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Jul 2015 08:24:56 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.41 as permitted sender) client-ip=209.85.215.41; Received: by lahh5 with SMTP id h5so27259106lah.2 for ; Thu, 30 Jul 2015 08:24:56 -0700 (PDT) X-Received: by 10.152.5.228 with SMTP id v4mr44775609lav.36.1438269896086; Thu, 30 Jul 2015 08:24:56 -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.7.198 with SMTP id l6csp686176lba; Thu, 30 Jul 2015 08:24:55 -0700 (PDT) X-Received: by 10.55.27.97 with SMTP id b94mr70937429qkb.3.1438269894801; Thu, 30 Jul 2015 08:24:54 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id u6si1649889qge.46.2015.07.30.08.24.54; Thu, 30 Jul 2015 08:24:54 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Received: by lists.linaro.org (Postfix, from userid 109) id 0EB7F61F48; Thu, 30 Jul 2015 15:24:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from ip-10-142-244-252.ec2.internal (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 1657561F5E; Thu, 30 Jul 2015 15:24:21 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 299D561F1F; Thu, 30 Jul 2015 15:23:52 +0000 (UTC) Received: from mail-pa0-f47.google.com (mail-pa0-f47.google.com [209.85.220.47]) by lists.linaro.org (Postfix) with ESMTPS id 3A63361F2B for ; Thu, 30 Jul 2015 15:23:15 +0000 (UTC) Received: by pacan13 with SMTP id an13so25573710pac.1 for ; Thu, 30 Jul 2015 08:23:14 -0700 (PDT) X-Received: by 10.67.3.9 with SMTP id bs9mr107171531pad.136.1438269794523; Thu, 30 Jul 2015 08:23:14 -0700 (PDT) Received: from localhost.localdomain ([122.166.219.57]) by smtp.gmail.com with ESMTPSA id j3sm2740206pdf.76.2015.07.30.08.23.11 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 30 Jul 2015 08:23:13 -0700 (PDT) From: Balasubramanian Manoharan To: lng-odp@lists.linaro.org Date: Thu, 30 Jul 2015 20:53:00 +0530 Message-Id: <1438269780-5826-1-git-send-email-bala.manoharan@linaro.org> X-Mailer: git-send-email 1.9.1 X-Topics: patch Subject: [lng-odp] [PATCH] example: classifier: fix buffer size warning X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 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" X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: bala.manoharan@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.41 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 Fixes: https://bugs.linaro.org/show_bug.cgi?id=1722 Signed-off-by: Balasubramanian Manoharan --- example/classifier/odp_classifier.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/example/classifier/odp_classifier.c b/example/classifier/odp_classifier.c index 53c7fdf..b55a6f9 100644 --- a/example/classifier/odp_classifier.c +++ b/example/classifier/odp_classifier.c @@ -602,10 +602,12 @@ static int parse_pmr_policy(appl_args_t *appl_args, char *argv[], char *optarg) switch (term) { case ODP_PMR_SIP_ADDR: token = strtok(NULL, ":"); - strncpy(stats[policy_count].value, token, DISPLAY_STRING_LEN); + strncpy(stats[policy_count].value, token, + DISPLAY_STRING_LEN - 1); parse_ipv4_addr(token, &stats[policy_count].rule.val); token = strtok(NULL, ":"); - strncpy(stats[policy_count].mask, token, DISPLAY_STRING_LEN); + strncpy(stats[policy_count].mask, token, + DISPLAY_STRING_LEN - 1); parse_ipv4_mask(token, &stats[policy_count].rule.mask); stats[policy_count].val_sz = 4; break; @@ -617,7 +619,7 @@ static int parse_pmr_policy(appl_args_t *appl_args, char *argv[], char *optarg) /* Queue Name */ token = strtok(NULL, ":"); - strncpy(stats[policy_count].queue_name, token, ODP_QUEUE_NAME_LEN); + strncpy(stats[policy_count].queue_name, token, ODP_QUEUE_NAME_LEN - 1); appl_args->policy_count++; free(pmr_str); return 0;