-
Notifications
You must be signed in to change notification settings - Fork 506
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
test: add test for null byte in filename #1635
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1635 +/- ##
==========================================
+ Coverage 78.49% 80.81% +2.31%
==========================================
Files 291 291
Lines 5975 5993 +18
Branches 980 982 +2
==========================================
+ Hits 4690 4843 +153
+ Misses 1072 941 -131
+ Partials 213 209 -4
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more |
Turns out behaviour is a bit different on 3.7 (null bytes used to raise a different error) so I tweaked the test appropriately. |
In the coverage diff, are we looking to stay in a particular range.
|
There's no particular restriction on coverage, although I admit when it gets below 80% sometimes I go file bugs for particular areas that are missing testing, but that's just a source of potentially easy bugs for me to keep feeding into the system. ;) |
I'm also hoping that we'll have a GSoC contributor to work on pushing our coverage numbers up a bit further: |
* fix: add special case for 3.7 ValueError
Simple test to make sure that null bytes are handled correctly in filenames specified on the command line.
This is a kind of useless attack in practice for cve-bin-tool: you can only scan files you already have access to on the system so there's not much point in trying to disguise a file with a null byte. But since it's a relatively small test to prove that this isn't an issue for security compliance reasons, I'm just going to go ahead and add it.