-
Notifications
You must be signed in to change notification settings - Fork 614
[AutoPR- Security] Patch jq for CVE-2025-9403 [MEDIUM] #14952
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
LeoMar4
merged 1 commit into
microsoft:main
from
azurelinux-security:azure-autosec/jq/2.0/966839
Oct 30, 2025
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| From b5403362c386b80e4726f52897c5fe5d3705a9a6 Mon Sep 17 00:00:00 2001 | ||
| From: AllSpark <allspark@microsoft.com> | ||
| Date: Wed, 29 Oct 2025 05:38:18 +0000 | ||
| Subject: [PATCH] Fix expected value assertion for NaN value (fix #3393): - | ||
| Include math.h for isnan - Skip reparsing/roundtrip assertion when expected | ||
| is NaN under USE_DECNUM | ||
|
|
||
| Signed-off-by: Azure Linux Security Servicing Account <azurelinux-security@microsoft.com> | ||
| Upstream-reference: AI Backport of https://github.com/jqlang/jq/commit/304a0f7e0ec376bf0ecabf9f96b2ab3432548819.patch | ||
| --- | ||
| src/jq_test.c | 13 ++++++++----- | ||
| 1 file changed, 8 insertions(+), 5 deletions(-) | ||
|
|
||
| diff --git a/src/jq_test.c b/src/jq_test.c | ||
| index 7a396b9..0172a76 100644 | ||
| --- a/src/jq_test.c | ||
| +++ b/src/jq_test.c | ||
| @@ -2,6 +2,7 @@ | ||
| #include <stdio.h> | ||
| #include <string.h> | ||
| #include <stdlib.h> | ||
| +#include <math.h> | ||
| #include "jv.h" | ||
| #include "jq.h" | ||
|
|
||
| @@ -157,11 +158,13 @@ static void run_jq_tests(jv lib_dirs, int verbose, FILE *testdata) { | ||
| printf(" for test at line number %u: %s\n", lineno, prog); | ||
| pass = 0; | ||
| } | ||
| - jv as_string = jv_dump_string(jv_copy(expected), rand() & ~(JV_PRINT_COLOR|JV_PRINT_REFCOUNT)); | ||
| - jv reparsed = jv_parse_sized(jv_string_value(as_string), jv_string_length_bytes(jv_copy(as_string))); | ||
| - assert(jv_equal(jv_copy(expected), jv_copy(reparsed))); | ||
| - jv_free(as_string); | ||
| - jv_free(reparsed); | ||
| + if (!(jv_get_kind(expected) == JV_KIND_NUMBER && isnan(jv_number_value(expected)))) { | ||
| + jv as_string = jv_dump_string(jv_copy(expected), rand() & ~(JV_PRINT_COLOR|JV_PRINT_REFCOUNT)); | ||
| + jv reparsed = jv_parse_sized(jv_string_value(as_string), jv_string_length_bytes(jv_copy(as_string))); | ||
| + assert(jv_equal(jv_copy(expected), jv_copy(reparsed))); | ||
| + jv_free(as_string); | ||
| + jv_free(reparsed); | ||
| + } | ||
| jv_free(expected); | ||
| jv_free(actual); | ||
| } | ||
| -- | ||
| 2.45.4 | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Patch looks good to me :)