summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdio/sscanf.c
diff options
context:
space:
mode:
authordeischen <deischen@FreeBSD.org>2001-06-04 12:36:07 +0000
committerdeischen <deischen@FreeBSD.org>2001-06-04 12:36:07 +0000
commit44f9b5d24741ec013a13e0216f7f13eee0ee6ddd (patch)
treebef5b1990d5a5791e4a05ec08c31ed6903812f37 /lib/libc/stdio/sscanf.c
parent9f564ba0bda86acfc7aa6dc4131732e17c3f2ae4 (diff)
downloadFreeBSD-src-44f9b5d24741ec013a13e0216f7f13eee0ee6ddd.zip
FreeBSD-src-44f9b5d24741ec013a13e0216f7f13eee0ee6ddd.tar.gz
Properly initialize a temporary FILE that is allocated off the stack.
The change to reuse _up from FILE (to allow FILE to grow without changing size) overlooked FILE being allocated off the stack. Approved by: sobomax
Diffstat (limited to 'lib/libc/stdio/sscanf.c')
-rw-r--r--lib/libc/stdio/sscanf.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/libc/stdio/sscanf.c b/lib/libc/stdio/sscanf.c
index 2ed797e..c887788 100644
--- a/lib/libc/stdio/sscanf.c
+++ b/lib/libc/stdio/sscanf.c
@@ -77,6 +77,7 @@ sscanf(str, fmt, va_alist)
{
int ret;
va_list ap;
+ struct __sFILEX extra;
FILE f;
f._file = -1;
@@ -86,6 +87,8 @@ sscanf(str, fmt, va_alist)
f._read = eofread;
f._ub._base = NULL;
f._lb._base = NULL;
+ f._extra = &extra;
+ INITEXTRA(&f);
#if __STDC__
va_start(ap, fmt);
#else
OpenPOWER on IntegriCloud