Skip to content
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

tun: don't parse buffers that have not been filled with data #2278

Merged
merged 1 commit into from
Oct 8, 2023

Conversation

avagin
Copy link
Member

@avagin avagin commented Oct 5, 2023

read_ns_sys_file() can return an error, but we are trying to parse a buffer before checking a return code.

CID 417395 (#3 of 3): String not null terminated (STRING_NULL)
2. string_null: Passing unterminated string buf to strtol, which expects a null-terminated string.

@avagin avagin requested a review from kolyshkin October 5, 2023 23:29
@codecov-commenter
Copy link

codecov-commenter commented Oct 6, 2023

Codecov Report

Attention: 14 lines in your changes are missing coverage. Please review.

Comparison is base (c20fb83) 70.55% compared to head (7fe073d) 70.54%.
Report is 3 commits behind head on criu-dev.

❗ Current head 7fe073d differs from pull request most recent head 8c1091c. Consider uploading reports for the commit 8c1091c to get more accurate results

Additional details and impacted files
@@             Coverage Diff              @@
##           criu-dev    #2278      +/-   ##
============================================
- Coverage     70.55%   70.54%   -0.01%     
============================================
  Files           132      132              
  Lines         33511    33513       +2     
============================================
  Hits          23643    23643              
- Misses         9868     9870       +2     
Files Coverage Δ
criu/tun.c 73.93% <100.00%> (-0.23%) ⬇️
criu/net.c 76.60% <60.00%> (-0.09%) ⬇️
criu/util.c 63.10% <14.28%> (-0.19%) ⬇️

... and 2 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

criu/net.c Show resolved Hide resolved
criu/net.c Outdated Show resolved Hide resolved
criu/net.c Show resolved Hide resolved
criu/net.c Outdated Show resolved Hide resolved
read_ns_sys_file() can return an error, but we are trying to parse a
buffer before checking a return code.

CID 417395 (#3 of 3): String not null terminated (STRING_NULL)
2. string_null: Passing unterminated string buf to strtol, which expects
   a null-terminated string.

Signed-off-by: Andrei Vagin <[email protected]>
@avagin avagin merged commit 4e5247a into checkpoint-restore:criu-dev Oct 8, 2023
36 of 39 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants