-
Notifications
You must be signed in to change notification settings - Fork 81
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
Only output CSV when using CSV option #46
Comments
I think this has been resolved now, correct? |
Version 2.0.16 has been released, and I believe that problem is now fixed, so closing. If it's NOT fixed, please reopen. |
In flawfinder 2.0.18 the error messages are still mixed with the CSV output. def internal_warn(message): # C Language Specific def internal_warn(message): # C Language Specific This is the CSV output showing the problem: File,Line,Column,DefaultLevel,Level,Category,Name,Warning,Suggestion,Note,CWEs,Context,Fingerprint,ToolVersion,RuleId,HelpUri /* copy string (truncating the result, strings must not be NULL) */ |
Problem
Flawfinder includes plaintext error messages in CSV output, which prevents one from parsing it as CSV.
Flawfinder manpage says the
--csv
option will:However, if theres a "Parsing failed to find..." error during the flawfinder scan, this error message is included in the output between the header row and data rows.
When sending this CSV to tool other tools for processing, they fail to parse just after the header because of the error message.
Steps to reproduce
docker run -it python:3 bash
pip install flawfinder
echo $'# define SOAP_SNPRINTF_SAFE(buf, len) void)sprintf((buf)\n;' > test.h
flawfinder --csv test.h
Output:
Proposal
Flawfinder's
--csv
option should only output CSV to STDOUT.Basically
flawfinder --csv . | grep ','
but native and in Python. 😅 🐍Context
The text was updated successfully, but these errors were encountered: