From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id B8940A0577; Mon, 6 Apr 2020 13:31:09 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 95D2A1BED9; Mon, 6 Apr 2020 13:31:08 +0200 (CEST) Received: from mail-lj1-f195.google.com (mail-lj1-f195.google.com [209.85.208.195]) by dpdk.org (Postfix) with ESMTP id BD6BE1BED9 for ; Mon, 6 Apr 2020 13:31:06 +0200 (CEST) Received: by mail-lj1-f195.google.com with SMTP id v16so14279326ljg.5 for ; Mon, 06 Apr 2020 04:31:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=emumba-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=P/TmNd2PKxTlJPxBQifWC6DVz7bEe9Xfg6AOnaNQCdg=; b=layCt+0sjJ5uK+1GvfOKnILj4wcBZcCxlPjxAORmI3zcxIbV69PbuyrNt6/U/k/KvY VYicsextuzw38j/7oLnjtQz3sWsQHmFZQ7CBqzowsgg8jh8TkJQSuRYh4ED3RsP5WKFk aM+WlFcwZ6Fgx9S1HT9WQj/knHFNdHiwgFvgkENwvB6TCRjGtwPA4iBe321wJz6OciXn uVg6qZ8LnL2lKkTukUgzrZLmHv5Ug+BCPHwmQncwX3trRueaD19zM/ZuXY6JFkQBW8gB iE0+jmrXZ3qENnxlth6foZXKAi9tqizCqwlsO6RumB4DjnF/Nwnu1p8HytYF4XXu4mW1 NdCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=P/TmNd2PKxTlJPxBQifWC6DVz7bEe9Xfg6AOnaNQCdg=; b=pEzZhIB1EC/eOkPsMHqMPtFn24LzbwXEMHAZ9o9xnFKao5iteYOkJIdvJyi9RSg3Bk urydQ3Iui96PuhfF9Y9lUDFfgOuRuDzjY1Co/UfYo8GkPy/ecpSCtZZT0ixAY7DAztPp R7AGlJ9w68zNqK7anto3j4xcAuxB0NSY/EKsSPc7aKhC9mQlP4dddw6becJSMhntAJ5a /rqLXbE8FUB8iZprQQdsnsqyHeX7pq6v5IuiN0Bp6abY9nW9ExvEiowbaZfIaqwnr7rF ScTekdifUCy+5obFFLW4Sxrkh78/VaCdQBSAG3g5/4jdBnDjfgNparNt2s5psC7U1cqt Yp1g== X-Gm-Message-State: AGi0PubJaewtHFb0pK7rqTF6mihuQartPozGd3TOen08yfRfLs+waVMD kYWxz5+uc9A8YIldQ5cTt6GL+w== X-Google-Smtp-Source: APiQypLudicRf2JgIu9VMYL6VwJeipzoh1RA7JPTdzuwxisBApIaIFWpZ5skA0k7LT2zfET1zZBgnw== X-Received: by 2002:a2e:b446:: with SMTP id o6mr12037907ljm.80.1586172666105; Mon, 06 Apr 2020 04:31:06 -0700 (PDT) Received: from localhost.localdomain ([103.255.6.82]) by smtp.gmail.com with ESMTPSA id u25sm11273360lfm.97.2020.04.06.04.31.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Apr 2020 04:31:05 -0700 (PDT) From: Muhammad Bilal To: hemant.agrawal@nxp.com, olivier.matz@6wind.com Cc: dev@dpdk.org, Muhammad Bilal , stable@dpdk.org Date: Mon, 6 Apr 2020 16:30:20 +0500 Message-Id: <20200406113020.8074-1-m.bilal@emumba.com> X-Mailer: git-send-email 2.17.1 Subject: [dpdk-dev] [PATCH] putting null checks on ops_name X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Bugzilla ID: 353 Cc: dev@dpdk.org Cc: stable@dpdk.org Cc: hemant.agrawal@nxp.com Signed-off-by: Muhammad Bilal --- lib/librte_mbuf/rte_mbuf_pool_ops.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/librte_mbuf/rte_mbuf_pool_ops.c b/lib/librte_mbuf/rte_mbuf_pool_ops.c index 5722976fe..c3ddfc0bd 100644 --- a/lib/librte_mbuf/rte_mbuf_pool_ops.c +++ b/lib/librte_mbuf/rte_mbuf_pool_ops.c @@ -13,7 +13,8 @@ int rte_mbuf_set_platform_mempool_ops(const char *ops_name) { const struct rte_memzone *mz; - + if (strlen(ops_name) == 0) + return -1; if (strlen(ops_name) >= RTE_MEMPOOL_OPS_NAMESIZE) return -ENAMETOOLONG; @@ -50,7 +51,8 @@ int rte_mbuf_set_user_mempool_ops(const char *ops_name) { const struct rte_memzone *mz; - + if (strlen(ops_name) == 0) + return -1; if (strlen(ops_name) >= RTE_MEMPOOL_OPS_NAMESIZE) return -ENAMETOOLONG; -- 2.17.1