about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--doc/HISTORY5
-rw-r--r--lib/util/vasprintf.c6
-rw-r--r--version.mk2
3 files changed, 10 insertions, 3 deletions
diff --git a/doc/HISTORY b/doc/HISTORY
index 6927a827..94b4d3b1 100644
--- a/doc/HISTORY
+++ b/doc/HISTORY
@@ -4,6 +4,11 @@ Netpbm.
 CHANGE HISTORY 
 --------------
 
+13.12.03 BJH  Release 10.47.47
+
+              Fix wild pointer dereference when memory allocation for a string
+              fails.  Broken since 10.36 (September 2006).
+
 13.09.26 BJH  Release 10.47.46
 
               Fixes for Mingw build with MSYS shell.
diff --git a/lib/util/vasprintf.c b/lib/util/vasprintf.c
index 6d350f88..47b4079d 100644
--- a/lib/util/vasprintf.c
+++ b/lib/util/vasprintf.c
@@ -18,9 +18,11 @@ vasprintfN(const char ** const resultP,
     char * result;
 
 #if HAVE_VASPRINTF
-    vasprintf(&result, format, varargs);
+    int rc;
 
-    if (result == NULL)
+    rc = vasprintf(&result, format, varargs);
+
+    if (rc < 0)
         *resultP = strsol;
     else
         *resultP = result;
diff --git a/version.mk b/version.mk
index 62757ee7..6176226f 100644
--- a/version.mk
+++ b/version.mk
@@ -1,3 +1,3 @@
 NETPBM_MAJOR_RELEASE = 10
 NETPBM_MINOR_RELEASE = 47
-NETPBM_POINT_RELEASE = 46
+NETPBM_POINT_RELEASE = 47