-
Notifications
You must be signed in to change notification settings - Fork 1
CMFSUPPORT-3890 : COVERITY TEST. DO NOT MERGE #11
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -698,7 +698,7 @@ | |||||
| { | ||||||
| char* cursor = content_data; | ||||||
| char* eof = content_data + content_len; | ||||||
|
|
||||||
| printf("Test coverity flow %s"); | ||||||
|
||||||
| printf("Test coverity flow %s"); | |
| CosaPhpExtLog("Test coverity flow\n"); |
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.
Coverity Issue - Printf arg count mismatch
the format string requires additional arguments
Medium Impact, CWE-685
PW.TOO_FEW_PRINTF_ARGS
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.
Coverity Issue - Missing argument to printf format specifier
No argument for format specifier "%s".
Medium Impact, CWE-685
PRINTF_ARGS
Check warning
Code scanning / CodeQL
Too few arguments to formatting function Medium
Copilot Autofix
AI 6 months ago
In general, to fix “too few arguments to formatting function” issues, either (a) remove or adjust the format specifiers so they match the actual number and types of arguments passed, or (b) add the missing arguments of the correct types to the call. The goal is for each
%specifier in the format string to have a corresponding argument.For this specific call in
source/jst_post.cat line 701:the simplest and safest fix without changing existing functionality is to remove the unused
%splaceholder, because there is no obvious string we should be printing there and the message appears to just be a static debug string. Changing it to:or
eliminates the format-argument mismatch while preserving the intended debug output. No new imports or helper methods are needed, and the behavior remains a simple console message. If you prefer to keep the
%sfor some reason, you would instead need to add a corresponding string argument, such asprintf("Test coverity flow %s", "");, but that is unnecessarily confusing compared to removing the specifier.The change is localized to the
parse_mpfdfunction insource/jst_post.c, around line 701, and requires only editing that singleprintfline.