Skip to content

Conversation

@ejohnstown
Copy link
Contributor

  1. String not null terminated: 572834
  2. Dereference before null check: 572919 572847
  3. Buffer not null terminated: 572891
  4. Argument cannot be negative: 573009 572928 572868

1. Swap out strdup() for a malloc() and memcpy(). Then nul terminate the
   string before tokenizing.

Fixes CID: 572834
1. When cleaning the path, check that the path pointer is not null
   before using it.
2. Move the strlen of path.
3. Remove the second check of path, and just loop over it.

Fixed CID: 572847
1. After getting the user's pw info, don't check that the shell value is
   null. We've already use it at that point.

Fixes CID: 572919
1. When copying the shell, leave a byte free in the dest buffer. Fill it
   with a null.

Fixes CID: 572891
1. Due to not checking the result of fseek(), it is possible to try to
   malloc() -1 bytes of storage. Checking the return from fseek() and
   erring if negative.
2. Changing the check between the result of fseek() and fread() to match
   signedness. Adding some casting, as at that point the fseek() result
   is always positive.

Fixes CIDs:
  573009 572928 572868
@JacobBarthelmeh JacobBarthelmeh merged commit 3a87c57 into wolfSSL:master Jul 21, 2025
93 checks passed
@ejohnstown ejohnstown deleted the cov branch July 21, 2025 22:24
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