Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F162909726
D16595.id46306.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
825 B
Referenced Files
None
Subscribers
None
D16595.id46306.diff
View Options
Index: usr.sbin/tzsetup/tzsetup.c
===================================================================
--- usr.sbin/tzsetup/tzsetup.c
+++ usr.sbin/tzsetup/tzsetup.c
@@ -481,7 +481,7 @@
char contbuf[16];
FILE *fp;
struct continent *cont;
- size_t len;
+ size_t len, filelen;
char *line, *tlc, *file, *descr, *p;
int lineno;
@@ -508,8 +508,11 @@
if (p == NULL)
errx(1, "%s:%d: invalid zone name `%s'", path_zonetab,
lineno, file);
- contbuf[0] = '\0';
- strncat(contbuf, file, p - file);
+ filelen = p - file + 1; /* trailing nul */
+ if (filelen > sizeof(contbuf))
+ errx(1, "%s:%d: zone name `%s' too long", path_zonetab,
+ lineno, file);
+ strlcpy(contbuf, file, filelen);
cont = find_continent(contbuf);
if (!cont)
errx(1, "%s:%d: invalid region `%s'", path_zonetab,
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Jul 19, 5:27 AM (11 h, 26 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
35222194
Default Alt Text
D16595.id46306.diff (825 B)
Attached To
Mode
D16595: Always terminate string with nul.
Attached
Detach File
Event Timeline
Log In to Comment