summaryrefslogtreecommitdiff
path: root/testing/glibc/glibc-2.15-scanf.patch
diff options
context:
space:
mode:
Diffstat (limited to 'testing/glibc/glibc-2.15-scanf.patch')
-rw-r--r--testing/glibc/glibc-2.15-scanf.patch32
1 files changed, 32 insertions, 0 deletions
diff --git a/testing/glibc/glibc-2.15-scanf.patch b/testing/glibc/glibc-2.15-scanf.patch
new file mode 100644
index 000000000..7655ae5ab
--- /dev/null
+++ b/testing/glibc/glibc-2.15-scanf.patch
@@ -0,0 +1,32 @@
+From 20b38e0301279a37a3f1e769843933bcc0d5f736 Mon Sep 17 00:00:00 2001
+From: Paul Pluzhnikov <ppluzhnikov@google.com>
+Date: Sun, 8 Jan 2012 20:13:35 -0500
+Subject: [PATCH 1/1] sscanf always calls realloc
+
+---
+ ChangeLog | 5 +++++
+ stdio-common/vfscanf.c | 4 ++--
+ 2 files changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/stdio-common/vfscanf.c b/stdio-common/vfscanf.c
+index 0e71deb..e18a6c3 100644
+--- a/stdio-common/vfscanf.c
++++ b/stdio-common/vfscanf.c
+@@ -1,4 +1,4 @@
+-/* Copyright (C) 1991-2006, 2007, 2010, 2011 Free Software Foundation, Inc.
++/* Copyright (C) 1991-2007, 2010, 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
+@@ -274,7 +274,7 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
+ CHAR_T *old = wp; \
+ size_t newsize = (UCHAR_MAX + 1 > 2 * wpmax \
+ ? UCHAR_MAX + 1 : 2 * wpmax); \
+- if (use_malloc || __libc_use_alloca (newsize)) \
++ if (use_malloc || !__libc_use_alloca (newsize)) \
+ { \
+ wp = realloc (use_malloc ? wp : NULL, newsize); \
+ if (wp == NULL) \
+--
+1.7.3.4
+