From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1E30C489EF for ; Mon, 27 Oct 2025 17:20:32 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 18FD44028B; Mon, 27 Oct 2025 17:20:32 +0100 (CET) Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.44]) by mails.dpdk.org (Postfix) with ESMTP id BFBCA40647 for ; Mon, 27 Oct 2025 17:20:30 +0100 (CET) Received: by mail-wr1-f44.google.com with SMTP id ffacd0b85a97d-3ee15b5435bso3639034f8f.0 for ; Mon, 27 Oct 2025 09:20:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1761582030; x=1762186830; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=jCwkGF6JVne+gkcX+NUS6RlWkM+aPPtpDFuC+wQ2mzI=; b=dTCAlM0po2lcuRsFZcblNg1+dJsfsM86Glc7oqXqXY8MJ7coVqc/bH8SZTaxYrjlJm +2ReaJcL/XmZfcNPUPN9Bu9lm40CknkF0OkYTRDmQcZskgJHnFpCIWUR9J1gIJ2XYqzS t8Z2t/f9V0pDMcOewlpPgMxoZGfSpZfiKW+2stfGiCkHiRB+mMA+ThJbF8tAAwgAfw8w R6CPWle/f31fhdsd2TImteq17eHMdg7+H4RqXWujsoS9YXXpAtF8+laYw0WVmovlvDqW +PSP5lnY26OT55jghWP3PpWcq7hr5MoQWqGTsxyH+g6NG312r/fcFRZJYDkFtS4z3v7h sSWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761582030; x=1762186830; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=jCwkGF6JVne+gkcX+NUS6RlWkM+aPPtpDFuC+wQ2mzI=; b=ntMi89zglSFK5zyUICYbGSRhn/CQjIjwmgt99UPVFJUr7eJrSEvaMJS/h1kbEjPMCp sYYzyDZtczGD1T4n2PLQ2ytjMaXuSnTugqaXXWJ3Ux1m6wsm9BaPX9GucT+x8Ute3YTP 5trQ7Xtg9W6UMW1OlcpsjipwmHmflFjWCh2R2jkxsfSawALHCJbuN61xSdmTh8sRbpF/ 15xhYvSb1jmmK3uH/iLzk4N1u9jAs7n0OYQYDVB44Q4nDqPnHNnbpL4WuiVSheLGTmRH lfL/nijDGh1gTCKrO7Avm8cG5izPUJ7ktXOwhqRg9jELYUxxYW4BljbTkE9wkLpk8OKg 0eug== X-Forwarded-Encrypted: i=1; AJvYcCVxVooG87LjV9jWzU5wGMsaWpuCAE1zhT4dSBdkUZKYspOGOxqfyLYRwdVQLOK6q4R+VGZ7Tis=@dpdk.org X-Gm-Message-State: AOJu0YzIn7zYdu9A+oZFGlhVFoQuweTHY5GtQMIs7FlsiGE6BxqBoNHd DJUZKKy6zlzDHwo7mpxBAemaPxpIYCnHQboXQaGLXKx/MJtKSTGbEBIop8Bg3g== X-Gm-Gg: ASbGncs0y8ZmaLTOLGIp9LJwps4eeivZR3iM6uWUTMCOq47IEhslBcb4cMEn7QMUOCO 1O6zs52vgqVm5ROA/Unrbh9iIbCNgq8baz4ORD9PTzAy3SRtMPwzo1PpJ7MiROBuqcDNvMCATzg AsYvbm9bJmBfrgLGxoAwvYoN5xdjrOXUWBSE21i1Jgr40Jifou/3ONoC0frC4DXT+/p9gowkQt3 wbYhz0qGG4RQd4zmqF56tcp3RzQta4J/p07bLccb8juFwu2Z7UeznWTd3BrD0cdlf8vvGtKd8iy Z9fQXpysYzEtCuLie3oAYNWZYOrCsLXPgNV1AFOPHOmYV8NOZTMnh7+ErRIZanAzdLbuXwzAiBj nXtNNkuLVJnmKJ4cIooUnLJwgb9urgSz9RF1i9oQOcG51eBYphDZ6YZD11TJVGEe2wRF8TAq0im 7hQeR2dky7Us6IfGuC6ddz9d40MtI= X-Google-Smtp-Source: AGHT+IGvDTWyc56ZsVT6JO11V01Zzzr1AeGvYEed9hJeYGC2WsM/hKiLbJRTy0l6oCUUs5ywIu9OAw== X-Received: by 2002:a05:6000:2c05:b0:428:4354:aa36 with SMTP id ffacd0b85a97d-429a7e919f2mr268117f8f.58.1761582030241; Mon, 27 Oct 2025 09:20:30 -0700 (PDT) Received: from localhost ([2a01:4b00:d036:ae00:6fc5:c3bc:147e:832c]) by smtp.gmail.com with UTF8SMTPSA id ffacd0b85a97d-429952d9e80sm15141945f8f.28.2025.10.27.09.20.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Oct 2025 09:20:29 -0700 (PDT) From: luca.boccassi@gmail.com To: David Marchand Cc: Bruce Richardson , Cristian Dumitrescu , Chengwen Feng , dpdk stable Subject: patch 'cfgfile: fix section count with no name' has been queued to stable release 22.11.11 Date: Mon, 27 Oct 2025 16:18:47 +0000 Message-ID: <20251027162001.3710450-9-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251027162001.3710450-1-luca.boccassi@gmail.com> References: <20251027162001.3710450-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Hi, FYI, your patch has been queued to stable release 22.11.11 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 10/29/25. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/1fe0c716154309029fa3a5d4fc550e159edaee35 Thanks. Luca Boccassi --- >From 1fe0c716154309029fa3a5d4fc550e159edaee35 Mon Sep 17 00:00:00 2001 From: David Marchand Date: Mon, 3 Feb 2025 13:33:19 +0100 Subject: [PATCH] cfgfile: fix section count with no name [ upstream commit 02bce2f1e938b409bb6f85391510a2a33ecc1443 ] Passing a NULL to strncmp is incorrect. + ------------------------------------------------------- + + Test Suite : Test Cfgfile Unit Test Suite + ------------------------------------------------------- + ../lib/cfgfile/rte_cfgfile.c:475:7: runtime error: null pointer passed as argument 2, which is declared to never be null On the other hand, it seems the intent was to count all sections, so skip the whole loop and section name comparisons. Fixes: c54e7234bc9e ("test/cfgfile: add basic unit tests") Signed-off-by: David Marchand Acked-by: Bruce Richardson Acked-by: Cristian Dumitrescu Acked-by: Chengwen Feng --- lib/cfgfile/rte_cfgfile.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/cfgfile/rte_cfgfile.c b/lib/cfgfile/rte_cfgfile.c index e2f77d2b64..b3701eeeb4 100644 --- a/lib/cfgfile/rte_cfgfile.c +++ b/lib/cfgfile/rte_cfgfile.c @@ -465,10 +465,14 @@ int rte_cfgfile_close(struct rte_cfgfile *cfg) int rte_cfgfile_num_sections(struct rte_cfgfile *cfg, const char *sectionname, -size_t length) + size_t length) { - int i; int num_sections = 0; + int i; + + if (sectionname == NULL) + return cfg->num_sections; + for (i = 0; i < cfg->num_sections; i++) { if (strncmp(cfg->sections[i].name, sectionname, length) == 0) num_sections++; -- 2.47.3 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2025-10-27 15:54:35.181996801 +0000 +++ 0009-cfgfile-fix-section-count-with-no-name.patch 2025-10-27 15:54:34.719947643 +0000 @@ -1 +1 @@ -From 02bce2f1e938b409bb6f85391510a2a33ecc1443 Mon Sep 17 00:00:00 2001 +From 1fe0c716154309029fa3a5d4fc550e159edaee35 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 02bce2f1e938b409bb6f85391510a2a33ecc1443 ] + @@ -28 +30 @@ -index 8bbdcf146e..9723ec756f 100644 +index e2f77d2b64..b3701eeeb4 100644 @@ -31,2 +33,2 @@ -@@ -477,10 +477,14 @@ int rte_cfgfile_close(struct rte_cfgfile *cfg) - RTE_EXPORT_SYMBOL(rte_cfgfile_num_sections) +@@ -465,10 +465,14 @@ int rte_cfgfile_close(struct rte_cfgfile *cfg) +