mirror of
https://sourceware.org/git/glibc.git
synced 2025-08-08 17:42:12 +03:00
Always allow overwriting printf modifiers etc.
This commit is contained in:
@@ -1,3 +1,8 @@
|
|||||||
|
2010-12-24 Ulrich Drepper <drepper@gmail.com>
|
||||||
|
|
||||||
|
* stdio-common/vfprintf.c (vfprintf): If printf handlers are installed
|
||||||
|
always use the slow path.
|
||||||
|
|
||||||
2010-12-15 Ryan S. Arnold <rsa@us.ibm.com>
|
2010-12-15 Ryan S. Arnold <rsa@us.ibm.com>
|
||||||
|
|
||||||
* elf/Makefile: (check-execstack): Replace $(native-compile) with a
|
* elf/Makefile: (check-execstack): Replace $(native-compile) with a
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
/* Copyright (C) 1991-2008, 2009 Free Software Foundation, Inc.
|
/* Copyright (C) 1991-2008, 2009, 2010 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
@@ -329,7 +329,7 @@ vfprintf (FILE *s, const CHAR_T *format, va_list ap)
|
|||||||
REF (form_floathex), /* for 'A', 'a' */ \
|
REF (form_floathex), /* for 'A', 'a' */ \
|
||||||
REF (mod_ptrdiff_t), /* for 't' */ \
|
REF (mod_ptrdiff_t), /* for 't' */ \
|
||||||
REF (mod_intmax_t), /* for 'j' */ \
|
REF (mod_intmax_t), /* for 'j' */ \
|
||||||
REF (flag_i18n), /* for 'I' */ \
|
REF (flag_i18n), /* for 'I' */ \
|
||||||
}; \
|
}; \
|
||||||
/* Step 1: after processing width. */ \
|
/* Step 1: after processing width. */ \
|
||||||
static JUMP_TABLE_TYPE step1_jumps[30] = \
|
static JUMP_TABLE_TYPE step1_jumps[30] = \
|
||||||
@@ -540,7 +540,7 @@ vfprintf (FILE *s, const CHAR_T *format, va_list ap)
|
|||||||
if (is_long_num) \
|
if (is_long_num) \
|
||||||
signed_number = va_arg (ap, long int); \
|
signed_number = va_arg (ap, long int); \
|
||||||
else if (is_char) \
|
else if (is_char) \
|
||||||
signed_number = (signed char) va_arg (ap, unsigned int); \
|
signed_number = (signed char) va_arg (ap, unsigned int); \
|
||||||
else if (!is_short) \
|
else if (!is_short) \
|
||||||
signed_number = va_arg (ap, int); \
|
signed_number = va_arg (ap, int); \
|
||||||
else \
|
else \
|
||||||
@@ -636,7 +636,7 @@ vfprintf (FILE *s, const CHAR_T *format, va_list ap)
|
|||||||
if (is_long_num) \
|
if (is_long_num) \
|
||||||
number.word = va_arg (ap, unsigned long int); \
|
number.word = va_arg (ap, unsigned long int); \
|
||||||
else if (is_char) \
|
else if (is_char) \
|
||||||
number.word = (unsigned char) va_arg (ap, unsigned int); \
|
number.word = (unsigned char) va_arg (ap, unsigned int); \
|
||||||
else if (!is_short) \
|
else if (!is_short) \
|
||||||
number.word = va_arg (ap, unsigned int); \
|
number.word = va_arg (ap, unsigned int); \
|
||||||
else \
|
else \
|
||||||
@@ -830,7 +830,7 @@ vfprintf (FILE *s, const CHAR_T *format, va_list ap)
|
|||||||
\
|
\
|
||||||
LABEL (form_floathex): \
|
LABEL (form_floathex): \
|
||||||
{ \
|
{ \
|
||||||
/* Floating point number printed as hexadecimal number. */ \
|
/* Floating point number printed as hexadecimal number. */ \
|
||||||
const void *ptr; \
|
const void *ptr; \
|
||||||
int function_done; \
|
int function_done; \
|
||||||
\
|
\
|
||||||
@@ -987,7 +987,7 @@ vfprintf (FILE *s, const CHAR_T *format, va_list ap)
|
|||||||
--width; \
|
--width; \
|
||||||
if (!left) \
|
if (!left) \
|
||||||
PAD (L' '); \
|
PAD (L' '); \
|
||||||
if (fspec == NULL) \
|
if (fspec == NULL) \
|
||||||
outchar (va_arg (ap, wchar_t)); \
|
outchar (va_arg (ap, wchar_t)); \
|
||||||
else \
|
else \
|
||||||
outchar (args_value[fspec->data_arg].pa_wchar); \
|
outchar (args_value[fspec->data_arg].pa_wchar); \
|
||||||
@@ -1241,7 +1241,7 @@ vfprintf (FILE *s, const CHAR_T *format, va_list ap)
|
|||||||
\
|
\
|
||||||
if (len == (size_t) -1) \
|
if (len == (size_t) -1) \
|
||||||
{ \
|
{ \
|
||||||
/* Illegal wide-character string. */ \
|
/* Illegal wide-character string. */ \
|
||||||
done = -1; \
|
done = -1; \
|
||||||
goto all_done; \
|
goto all_done; \
|
||||||
} \
|
} \
|
||||||
@@ -1318,6 +1318,12 @@ vfprintf (FILE *s, const CHAR_T *format, va_list ap)
|
|||||||
if (*f == L_('\0'))
|
if (*f == L_('\0'))
|
||||||
goto all_done;
|
goto all_done;
|
||||||
|
|
||||||
|
/* Use the slow path in case any printf handler is registered. */
|
||||||
|
if (__builtin_expect (__printf_function_table != NULL
|
||||||
|
|| __printf_modifier_table != NULL
|
||||||
|
|| __printf_va_arg_table != NULL, 0))
|
||||||
|
goto do_positional;
|
||||||
|
|
||||||
/* Process whole format string. */
|
/* Process whole format string. */
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user