Sophie

Sophie

distrib > Fedora > 14 > x86_64 > by-pkgid > 47af663d4ceeca8040a18d1337f9ea60 > files > 5

xmlrpc-c-1.23.03-1400.svn1979.fc14.src.rpm

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