Blame SOURCES/xmlrpc-c-check-vasprintf-return-value.patch

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