Page MenuHomeFreeBSD

Slight cleanup in open_binary_fd.
ClosedPublic

Authored by delphij on Jul 4 2017, 8:08 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sep 17 2024, 11:59 AM
Unknown Object (File)
Sep 9 2024, 1:12 AM
Unknown Object (File)
Sep 8 2024, 9:04 PM
Unknown Object (File)
Sep 7 2024, 2:40 PM
Unknown Object (File)
Sep 7 2024, 7:29 AM
Unknown Object (File)
Sep 1 2024, 10:19 AM
Unknown Object (File)
Aug 15 2024, 8:00 AM
Unknown Object (File)
Aug 11 2024, 7:03 PM
Subscribers

Details

Summary

In open_binary_fd: when using buffer size for strl* and snprintf,
always use >= instead of > to avoid truncation.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 10296
Build 10714: arc lint + arc unit

Event Timeline

libexec/rtld-elf/rtld.c
5309

Compare the size of ld.so before and after your patch is applied.

delphij added inline comments.
libexec/rtld-elf/rtld.c
5309

I haven't considered it (and thanks for pointing out). I'll update this one to a smaller scope.

delphij marked an inline comment as done.

In open_binary_fd: when using buffer size for strl* and snprintf,
always use >= instead of > to avoid truncation.

The issue with stdio in rtld is not limited to the bloat. Locale stuff that gets pulled in causes runtime breakage for rtld. One of the reason is that it uses TLS.

Overall, rtld is not a C hosted environment, which is obvious in hindsight.

This revision is now accepted and ready to land.Jul 5 2017, 5:22 AM
This revision was automatically updated to reflect the committed changes.