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)
Tue, Nov 19, 8:25 AM
Unknown Object (File)
Tue, Nov 19, 6:47 AM
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
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 Not Applicable
Unit
Tests Not Applicable

Event Timeline

libexec/rtld-elf/rtld.c
5309 ↗(On Diff #30393)

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

delphij added inline comments.
libexec/rtld-elf/rtld.c
5309 ↗(On Diff #30393)

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.