This change adds explicit buffer bounds checks to functions that write strings into buffers, replacing unsafe operations such as strcpy with safer alternatives using size checks and std::copy. It also ensures section and segment names do not overflow their target fields and adds error handling for negative offsets. These changes address potential buffer overflow vulnerabilities and make the code robust against out-of-bounds memory access.
Details
Details
- Reviewers
- None
Run static analyzers (such as Snyk ,and my hands)
Diff Detail
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Skipped - Unit
Tests Skipped