-
Notifications
You must be signed in to change notification settings - Fork 9
CMFSUPPORT-3863. COVERITY TEST. DO NOT MERGE #49
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 |
|---|---|---|
|
|
@@ -17,9 +17,10 @@ | |
| ########################################################################## | ||
| AM_CFLAGS = -D_ANSC_LINUX | ||
| AM_CFLAGS += -D_ANSC_USER | ||
| AM_CFLAGS += -Wno-format | ||
| AM_LDFLAGS = -lccsp_common -lsysevent -lwebconfig_framework -lmsgpackc -ltrower-base64 | ||
|
|
||
| AM_CPPFLAGS = -Wall -Werror | ||
| AM_CPPFLAGS = -Wall -Wno-format | ||
|
||
| ACLOCAL_AMFLAGS = -I m4 | ||
| hardware_platform = i686-linux-gnu | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change | |||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -291,7 +291,7 @@ | ||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||
| if ((file = fopen(fpath, "w"))) | |||||||||||||||||||||||||||||||||
| { | |||||||||||||||||||||||||||||||||
| fprintf(file,"%s",str); | |||||||||||||||||||||||||||||||||
| fprintf(file,"%s%s",str); | |||||||||||||||||||||||||||||||||
Check warningCode scanning / CodeQL Too few arguments to formatting function Medium
Format for fprintf expects 2 arguments but given 1
Copilot AutofixAI 3 days ago In general, to fix “too few arguments to formatting function” issues, ensure that the number and types of arguments following the format string match the conversion specifiers in the format. You can either adjust the format string to match the existing arguments or add the missing arguments to match the format specifiers. Here, Concretely:
Suggested changeset
1
source/AdvSecurityDml/cosa_adv_security_internal.c
Copilot is powered by AI and may make mistakes. Always verify output.
Refresh and try again.
|
|||||||||||||||||||||||||||||||||
| fprintf(file,"%s%s",str); | |
| fprintf(file, "%s", str); |
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
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.
Adding -Wno-format suppresses compiler warnings for format string mismatches, which would hide serious bugs like format string vulnerabilities and incorrect argument counts. This flag is masking the bug in line 294 of cosa_adv_security_internal.c where fprintf has mismatched format specifiers and arguments. Format warnings should not be suppressed as they catch critical security and correctness issues.