about summary refs log tree commit diff
path: root/stdio-common/vfprintf.c
diff options
context:
space:
mode:
authorPetr Baudis <pasky@suse.cz>2011-02-20 07:59:49 -0500
committerUlrich Drepper <drepper@gmail.com>2011-02-20 07:59:49 -0500
commit84a4211850e3d23a9d3a4f3b294752a3b30bc0ff (patch)
tree04faa4e3387e0e86f2c0fc9ef47af138f1258006 /stdio-common/vfprintf.c
parente23fe25b33324a9ea992276c1a4f04127bf9ba4b (diff)
downloadglibc-84a4211850e3d23a9d3a4f3b294752a3b30bc0ff.tar.gz
glibc-84a4211850e3d23a9d3a4f3b294752a3b30bc0ff.tar.xz
glibc-84a4211850e3d23a9d3a4f3b294752a3b30bc0ff.zip
Fix allocation when handling positional parameters in printf.
Diffstat (limited to 'stdio-common/vfprintf.c')
-rw-r--r--stdio-common/vfprintf.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/stdio-common/vfprintf.c b/stdio-common/vfprintf.c
index fc370e8cbc..cfa4c30b78 100644
--- a/stdio-common/vfprintf.c
+++ b/stdio-common/vfprintf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2008, 2009, 2010   Free Software Foundation, Inc.
+/* Copyright (C) 1991-2008, 2009, 2010, 2011   Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -1682,7 +1682,8 @@ do_positional:
 	  {
 	    /* Extend the array of format specifiers.  */
 	    struct printf_spec *old = specs;
-	    specs = extend_alloca (specs, nspecs_max, 2 * nspecs_max);
+	    specs = extend_alloca (specs, nspecs_max,
+				   2 * nspecs_max * sizeof (*specs));
 
 	    /* Copy the old array's elements to the new space.  */
 	    memmove (specs, old, nspecs * sizeof (struct printf_spec));