Page MenuHomeFreeBSD

Always terminate string with nul.
ClosedPublic

Authored by delphij on Aug 5 2018, 6:04 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Mar 30, 5:34 PM
Unknown Object (File)
Mar 11 2024, 3:34 PM
Unknown Object (File)
Mar 5 2024, 12:42 AM
Unknown Object (File)
Dec 30 2023, 11:13 PM
Unknown Object (File)
Dec 20 2023, 9:18 PM
Unknown Object (File)
Dec 20 2023, 1:50 AM
Unknown Object (File)
Dec 9 2023, 6:26 PM
Unknown Object (File)
Nov 25 2023, 6:24 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.