CMFSUPPORT-3609 TEST. DO NOT MERGE#324
Conversation
DO NOT MERGE
There was a problem hiding this comment.
Pull request overview
This PR modifies an error message in the toHexString function by removing one of the printf arguments, introducing a critical bug. The PR is marked as a test change that should not be merged.
- Modified error message printf statement to provide only one argument instead of two
- The change creates undefined behavior in the error reporting code
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| } else { | ||
| printf("ERROR: bufLength %d is too small for %d chars\n", *bufLength, totalLength); | ||
| printf("ERROR: bufLength %d is too small for %d chars\n", totalLength); |
There was a problem hiding this comment.
The printf statement now has only one format argument (%d) but only provides one value (totalLength), whereas the original error message format string has two %d placeholders. This means the second %d will print garbage/undefined values. The original version correctly provided both *bufLength and totalLength as arguments to match the two %d format specifiers in the error message.
| printf("ERROR: bufLength %d is too small for %d chars\n", totalLength); | |
| printf("ERROR: bufLength %d is too small for %d chars\n", *bufLength, totalLength); |
|
|
||
| } else { | ||
| printf("ERROR: bufLength %d is too small for %d chars\n", *bufLength, totalLength); | ||
| printf("ERROR: bufLength %d is too small for %d chars\n", totalLength); |
There was a problem hiding this comment.
Coverity Issue - Printf arg count mismatch
the format string requires additional arguments
Medium Impact, CWE-685
PW.TOO_FEW_PRINTF_ARGS
|
|
||
| } else { | ||
| printf("ERROR: bufLength %d is too small for %d chars\n", *bufLength, totalLength); | ||
| printf("ERROR: bufLength %d is too small for %d chars\n", totalLength); |
There was a problem hiding this comment.
Coverity Issue - Missing argument to printf format specifier
No argument for format specifier "%d".
Medium Impact, CWE-685
PRINTF_ARGS
DO NOT MERGE