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)
Mar 16 2024, 8:11 PM
Unknown Object (File)
Jan 26 2024, 7:09 PM
Unknown Object (File)
Jan 5 2024, 5:37 PM
Unknown Object (File)
Dec 27 2023, 10:39 PM
Unknown Object (File)
Dec 25 2023, 9:38 AM
Unknown Object (File)
Dec 20 2023, 2:48 AM
Unknown Object (File)
Nov 23 2023, 8:19 PM
Unknown Object (File)
Nov 22 2023, 8:13 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.