Page MenuHomeFreeBSD

D8286.id21501.diff
No OneTemporary

D8286.id21501.diff

Index: contrib/netbsd-tests/lib/libc/stdio/t_printf.c
===================================================================
--- contrib/netbsd-tests/lib/libc/stdio/t_printf.c
+++ contrib/netbsd-tests/lib/libc/stdio/t_printf.c
@@ -120,12 +120,6 @@
{
char s[16], fmt[32];
-#ifndef __NetBSD__
- atf_tc_expect_signal(SIGSEGV,
- "some non-NetBSD platforms including FreeBSD don't validate "
- "negative size; testcase blows up with SIGSEGV");
-#endif
-
snprintf(fmt, sizeof(fmt), "%%%zu$d", SIZE_MAX / sizeof(size_t));
ATF_CHECK(snprintf(s, sizeof(s), fmt, -23) == -1);
Index: lib/libc/stdio/printf-pos.c
===================================================================
--- lib/libc/stdio/printf-pos.c
+++ lib/libc/stdio/printf-pos.c
@@ -113,6 +113,10 @@
_ensurespace(struct typetable *types)
{
+ /* Validate sign first */
+ if (types->nextarg < 0)
+ return (-1);
+
if (types->nextarg >= types->tablesize) {
if (__grow_type_table(types))
return (-1);

File Metadata

Mime Type
text/plain
Expires
Mon, Mar 23, 1:28 AM (22 h, 3 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
30150952
Default Alt Text
D8286.id21501.diff (980 B)

Event Timeline