Strip leading ./ from SARIF artifact URIs for uriBaseId portability#102
Merged
Conversation
Removes leading "./" prefixes from file paths in SARIF output so they work correctly with the uriBaseId/SRCROOT placeholder, as requested in #67. Paths beginning with "-" retain "./" to avoid misinterpretation as CLI options by downstream tools. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: David A. Wheeler <dwheeler@dwheeler.com>
Signed-off-by: David A. Wheeler <dwheeler@dwheeler.com>
Functions named inside GCC attribute arguments (e.g. format(printf,...))
are compiler metadata, not callable expressions, and should not be flagged.
When __attribute__ is encountered in the token scan, _skip_attribute_args()
advances past the entire balanced ((...)) argument.
Known limitation: paren counting ignores string literals, so attribute
string arguments containing unbalanced '(' are a known edge case.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: David A. Wheeler <dwheeler@dwheeler.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: David A. Wheeler <dwheeler@dwheeler.com>
swprintf(buf, n, format, ...) has the format string at position 3, not 2. The old rule grouped swprintf with sprintf (position 2), so flawfinder was inspecting the size argument n rather than the format string, causing false positives on constant formats and missing non-constant ones. Split swprintf|vswprintf into their own rule with source_position=3, and add source_position to the Hit allowlist so rule overrides take effect. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: David A. Wheeler <dwheeler@dwheeler.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: David A. Wheeler <dwheeler@dwheeler.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Removes leading "./" prefixes from file paths in SARIF output so they work correctly with the uriBaseId/SRCROOT placeholder, as requested in #67. Paths beginning with "-" retain "./" to avoid misinterpretation as CLI options by downstream tools.