xmlrpc-c/xmlrpc-c-check-vasprintf-return-value.patch
Enrico Scholz 1051106385 - updated to 1.23.02 (note: this breaks C++ ABI)
- added vasprintf patch
2010-08-27 19:40:38 +02:00

42 lines
1.2 KiB
Diff

From 122cc57fd2501cabdec64c56c01ebfd7d380cb72 Mon Sep 17 00:00:00 2001
From: Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
Date: Thu, 29 Jul 2010 19:43:08 +0200
Subject: [PATCH 7/7] check vasprintf return value
---
lib/libutil/asprintf.c | 3 ++-
lib/util/casprintf.c | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/lib/libutil/asprintf.c b/lib/libutil/asprintf.c
index bb4ca56..2c5ce7f 100644
--- a/lib/libutil/asprintf.c
+++ b/lib/libutil/asprintf.c
@@ -100,7 +100,8 @@ xmlrpc_vasprintf(const char ** const retvalP,
char * string;
#if HAVE_ASPRINTF
- vasprintf(&string, fmt, varargs);
+ if (vasprintf(&string, fmt, varargs) < 0)
+ string = NULL;
#else
simpleVasprintf(&string, fmt, varargs);
#endif
diff --git a/lib/util/casprintf.c b/lib/util/casprintf.c
index 643f145..9139253 100644
--- a/lib/util/casprintf.c
+++ b/lib/util/casprintf.c
@@ -99,7 +99,8 @@ cvasprintf(const char ** const retvalP,
char * string;
#if HAVE_ASPRINTF
- vasprintf(&string, fmt, varargs);
+ if (vasprintf(&string, fmt, varargs) < 0)
+ string = NULL;
#else
simpleVasprintf(&string, fmt, varargs);
#endif
--
1.7.2.1