about summary refs log tree commit diff
path: root/stdio-common
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2007-12-07 16:50:11 +0000
committerUlrich Drepper <drepper@redhat.com>2007-12-07 16:50:11 +0000
commit26e21e7554ca5bbc719d5b018e26d5eb621c9e2e (patch)
treecba97f6eef732d9fbacf1cc5205f8e3eeeb8c1f1 /stdio-common
parentc9d65f0fbdf83d13e85a82d0b7b564d343a3c64b (diff)
downloadglibc-26e21e7554ca5bbc719d5b018e26d5eb621c9e2e.tar.gz
glibc-26e21e7554ca5bbc719d5b018e26d5eb621c9e2e.tar.xz
glibc-26e21e7554ca5bbc719d5b018e26d5eb621c9e2e.zip
[BZ #5441, BZ #5452, BZ #5454]
2007-12-07  Ulrich Drepper  <drepper@redhat.com>
	[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  <aurelien@aurel32.net>

	[BZ #5452]
	* sysdeps/unix/sysv/linux/bits/sched.h: Use __extension__
	  keyword for gcc's braced-groups.

2007-12-07  Ulrich Drepper  <drepper@redhat.com>

	[BZ #5454]
	* inet/ether_line.c: Strip hostname of whitespaces.
	* inet/Makefile (tests): Add tst-ether_line.
	* inet/tst-ether_line.c: New file.
Diffstat (limited to 'stdio-common')
-rw-r--r--stdio-common/Makefile2
-rw-r--r--stdio-common/bug21.c16
-rw-r--r--stdio-common/vfscanf.c1
3 files changed, 17 insertions, 2 deletions
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 <stdio.h>
+
+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;
 	    }
 	}