From 26e21e7554ca5bbc719d5b018e26d5eb621c9e2e Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Fri, 7 Dec 2007 16:50:11 +0000 Subject: [BZ #5441, BZ #5452, BZ #5454] 2007-12-07 Ulrich Drepper [BZ #5441] * stdio-common/vfscanf.c (_IO_vfwscanf): Don't free ptrs_to_free structure, it's allocated with alloca. * stdio-common/Makefile (tests): Add bug21. * stdio-common/bug21.c: New file. 2007-12-06 Aurelien Jarno [BZ #5452] * sysdeps/unix/sysv/linux/bits/sched.h: Use __extension__ keyword for gcc's braced-groups. 2007-12-07 Ulrich Drepper [BZ #5454] * inet/ether_line.c: Strip hostname of whitespaces. * inet/Makefile (tests): Add tst-ether_line. * inet/tst-ether_line.c: New file. --- stdio-common/Makefile | 2 +- stdio-common/bug21.c | 16 ++++++++++++++++ stdio-common/vfscanf.c | 1 - 3 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 stdio-common/bug21.c (limited to 'stdio-common') diff --git a/stdio-common/Makefile b/stdio-common/Makefile index d5b1251993..db622af22b 100644 --- a/stdio-common/Makefile +++ b/stdio-common/Makefile @@ -57,7 +57,7 @@ tests := tstscanf test_rdwr test-popen tstgetln test-fseek \ tst-perror tst-sprintf tst-rndseek tst-fdopen tst-fphex bug14 bug15 \ tst-popen tst-unlockedio tst-fmemopen2 tst-put-error tst-fgets \ tst-fwrite bug16 bug17 tst-swscanf tst-sprintf2 bug18 bug18a \ - bug19 bug19a tst-popen2 scanf13 scanf14 scanf15 bug20 + bug19 bug19a tst-popen2 scanf13 scanf14 scanf15 bug20 bug21 test-srcs = tst-unbputc tst-printf diff --git a/stdio-common/bug21.c b/stdio-common/bug21.c new file mode 100644 index 0000000000..d22b9c1a97 --- /dev/null +++ b/stdio-common/bug21.c @@ -0,0 +1,16 @@ +#include + +static int +do_test (void) +{ + static const char buf[] = " "; + char *str; + + int r = sscanf (buf, "%as", &str); + printf ("%d %p\n", r, str); + + return r != -1 || str != NULL; +} + +#define TEST_FUNCTION do_test () +#include "../test-skeleton.c" diff --git a/stdio-common/vfscanf.c b/stdio-common/vfscanf.c index f550109a90..a03e19c4e3 100644 --- a/stdio-common/vfscanf.c +++ b/stdio-common/vfscanf.c @@ -2845,7 +2845,6 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr, *p->ptrs[cnt] = NULL; } p = p->next; - free (ptrs_to_free); ptrs_to_free = p; } } -- cgit v1.2.3