patch 'examples/fips_validation: fix integer parsing' has been queued to stable release 22.11.2
Xueming Li
xuemingl at nvidia.com
Sun Apr 9 17:23:32 CEST 2023
Hi,
FYI, your patch has been queued to stable release 22.11.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/11/23. 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://git.dpdk.org/dpdk-stable/log/?h=22.11-staging
This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/809de506c9e510845882ec81d2aa4db28615ea4c
Thanks.
Xueming Li <xuemingl at nvidia.com>
---
>From 809de506c9e510845882ec81d2aa4db28615ea4c Mon Sep 17 00:00:00 2001
From: Gowrishankar Muthukrishnan <gmuthukrishn at marvell.com>
Date: Tue, 28 Feb 2023 22:58:49 +0530
Subject: [PATCH] examples/fips_validation: fix integer parsing
Cc: Xueming Li <xuemingl at nvidia.com>
[ upstream commit 6bbb90cc061b5c6a1931143cdf69390a0ef50ef0 ]
Parsing integer value in test case vector does not store
it because only string was expected. This patch adds handling
for integer value as well.
Fixes: 58cc98801eb ("examples/fips_validation: add JSON parsing")
Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn at marvell.com>
Acked-by: Brian Dooley <brian.dooley at intel.com>
---
examples/fips_validation/fips_validation.c | 29 ++++++++++++++++------
1 file changed, 21 insertions(+), 8 deletions(-)
diff --git a/examples/fips_validation/fips_validation.c b/examples/fips_validation/fips_validation.c
index f7a6d821ea..d3b6099d73 100644
--- a/examples/fips_validation/fips_validation.c
+++ b/examples/fips_validation/fips_validation.c
@@ -543,15 +543,28 @@ fips_test_parse_one_json_case(void)
for (i = 0; info.callbacks[i].key != NULL; i++) {
param = json_object_get(json_info.json_test_case, info.callbacks[i].key);
- if (param) {
- strcpy(info.one_line_text, json_string_value(param));
- ret = info.callbacks[i].cb(
- info.callbacks[i].key, info.one_line_text,
- info.callbacks[i].val
- );
- if (ret < 0)
- return ret;
+ if (!param)
+ continue;
+
+ switch (json_typeof(param)) {
+ case JSON_STRING:
+ snprintf(info.one_line_text, MAX_LINE_CHAR, "%s",
+ json_string_value(param));
+ break;
+
+ case JSON_INTEGER:
+ snprintf(info.one_line_text, MAX_LINE_CHAR, "%"JSON_INTEGER_FORMAT,
+ json_integer_value(param));
+ break;
+
+ default:
+ return -EINVAL;
}
+
+ ret = info.callbacks[i].cb(info.callbacks[i].key, info.one_line_text,
+ info.callbacks[i].val);
+ if (ret < 0)
+ return ret;
}
return 0;
--
2.25.1
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2023-04-09 21:45:39.437978700 +0800
+++ 0024-examples-fips_validation-fix-integer-parsing.patch 2023-04-09 21:45:38.609042200 +0800
@@ -1 +1 @@
-From 6bbb90cc061b5c6a1931143cdf69390a0ef50ef0 Mon Sep 17 00:00:00 2001
+From 809de506c9e510845882ec81d2aa4db28615ea4c Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit 6bbb90cc061b5c6a1931143cdf69390a0ef50ef0 ]
@@ -11 +13,0 @@
-Cc: stable at dpdk.org
More information about the stable
mailing list