Page MenuHomeFreeBSD

Always terminate string with nul.
ClosedPublic

Authored by delphij on Aug 5 2018, 6:04 AM.
Tags
None
Referenced Files
F102953637: D16595.id46314.diff
Tue, Nov 19, 3:48 AM
Unknown Object (File)
Fri, Nov 8, 1:16 AM
Unknown Object (File)
Oct 4 2024, 7:48 AM
Unknown Object (File)
Sep 17 2024, 10:49 AM
Unknown Object (File)
Aug 21 2024, 8:02 PM
Unknown Object (File)
Aug 12 2024, 6:29 PM
Unknown Object (File)
Aug 10 2024, 12:10 AM
Unknown Object (File)
Jul 27 2024, 7:49 AM
Subscribers

Details

Summary

In read_zones(), check if the file name actually fit in the buffer
and make sure it would fit with strlcpy().

Test Plan

run tzsetup

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Seems fine. Normally, these files aren't in the control of users...

usr.sbin/tzsetup/tzsetup.c
481 ↗(On Diff #46306)

16 is very short...

515 ↗(On Diff #46306)

stylistically, sizeof(contbuf) is better here. practically, it woudln't matter.

This revision is now accepted and ready to land.Aug 5 2018, 9:37 AM

And is there still an upstream for these files?

delphij marked an inline comment as done.

Clarify the code.

This revision now requires review to proceed.Aug 5 2018, 5:09 PM
usr.sbin/tzsetup/tzsetup.c
515 ↗(On Diff #46306)

I think the intention was to copy until '/' (e.g. for Europe/Andorra, the goal is to copy "Europe").

Now I realized that 'filelen' is a poor name so I have revised the code to make it more clear.

In D16595#352569, @imp wrote:

Normally, these files aren't in the control of users...

Yes this is not intended as a security fix.

In D16595#352574, @imp wrote:

And is there still an upstream for these files?

I think this is FreeBSD specific code and there was no upstream so we are probably the ultimate upstream.

This revision was not accepted when it landed; it landed in state Needs Review.Aug 9 2018, 2:47 AM
This revision was automatically updated to reflect the committed changes.