Skip to content

fix: use bounded strlcpy/snprintf in mptest.c...#46

Open
orbisai0security wants to merge 1 commit into
sqlite:masterfrom
orbisai0security:fix-insecure-strcpy-mptest
Open

fix: use bounded strlcpy/snprintf in mptest.c...#46
orbisai0security wants to merge 1 commit into
sqlite:masterfrom
orbisai0security:fix-insecure-strcpy-mptest

Conversation

@orbisai0security
Copy link
Copy Markdown

Summary

Fix high severity security issue in mptest/mptest.c.

Vulnerability

Field Value
ID c.lang.security.insecure-use-string-copy-fn.insecure-use-string-copy-fn
Severity HIGH
Scanner semgrep
Rule c.lang.security.insecure-use-string-copy-fn.insecure-use-string-copy-fn
File mptest/mptest.c:587

Description: Finding triggers whenever there is a strcpy or strncpy used. This is an issue because strcpy does not affirm the size of the destination array and strncpy will not automatically NULL-terminate strings. This can lead to buffer overflows, which can cause program crashes and potentially let an attacker inject code in the program. Fix this by using strcpy_s instead (although note that strcpy_s is an optional part of the C11 standard, and so may not be available).

Changes

  • mptest/mptest.c

Verification

  • Build passes
  • Scanner re-scan confirms fix
  • LLM code review passed

Automated security fix by OrbisAI Security

…copy-fn security vulnerability

Automated security fix generated by OrbisAI Security
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.

1 participant