diff options
author | Andreas Jaeger <aj@suse.de> | 2012-03-14 16:36:17 +0100 |
---|---|---|
committer | Andreas Jaeger <aj@suse.de> | 2012-03-14 16:36:17 +0100 |
commit | 356a10ee3ee36bec0af7e8a1c61e353e0af45904 (patch) | |
tree | 421de93f9f53c04d796ccd31102baf135dc55ed8 /stdio-common/vfprintf.c | |
parent | a20026128cef2e95ffd15fb293dd6b1e9bf3ae1e (diff) | |
parent | e456826d7a539fb322bb9719297bd386eded8e32 (diff) | |
download | glibc-356a10ee3ee36bec0af7e8a1c61e353e0af45904.tar.gz glibc-356a10ee3ee36bec0af7e8a1c61e353e0af45904.tar.xz glibc-356a10ee3ee36bec0af7e8a1c61e353e0af45904.zip |
Merge branch 'master' into bug13658-branch
Diffstat (limited to 'stdio-common/vfprintf.c')
-rw-r--r-- | stdio-common/vfprintf.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/stdio-common/vfprintf.c b/stdio-common/vfprintf.c index 85d19005d2..e454927bfd 100644 --- a/stdio-common/vfprintf.c +++ b/stdio-common/vfprintf.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991-2008, 2009, 2010, 2011 Free Software Foundation, Inc. +/* Copyright (C) 1991-2011, 2012 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 @@ -1706,28 +1706,28 @@ do_positional: nargs = MAX (nargs, max_ref_arg); /* Calculate total size needed to represent a single argument across all three argument-related arrays. */ - bytes_per_arg = sizeof (*args_value) + sizeof (*args_size) - + sizeof (*args_type); + bytes_per_arg = (sizeof (*args_value) + sizeof (*args_size) + + sizeof (*args_type)); /* Check for potential integer overflow. */ if (__builtin_expect (nargs > SIZE_MAX / bytes_per_arg, 0)) { - __set_errno (ERANGE); - done = -1; - goto all_done; + __set_errno (ERANGE); + done = -1; + goto all_done; } /* Allocate memory for all three argument arrays. */ if (__libc_use_alloca (nargs * bytes_per_arg)) - args_value = alloca (nargs * bytes_per_arg); + args_value = alloca (nargs * bytes_per_arg); else { - args_value = args_malloced = malloc (nargs * bytes_per_arg); - if (args_value == NULL) - { - done = -1; - goto all_done; - } + args_value = args_malloced = malloc (nargs * bytes_per_arg); + if (args_value == NULL) + { + done = -1; + goto all_done; + } } /* Set up the remaining two arrays to each point past the end of the |