[Libreoffice-commits] core.git: liblangtag/liblangtag-0.5.1-vsnprintf.patch

Eike Rathke erack at redhat.com
Fri Jul 19 08:31:56 PDT 2013


 liblangtag/liblangtag-0.5.1-vsnprintf.patch |   24 +++++++++++++++---------
 1 file changed, 15 insertions(+), 9 deletions(-)

New commits:
commit 226ae6dfd00b748753804c11690089e4346b5eb2
Author: Eike Rathke <erack at redhat.com>
Date:   Fri Jul 19 16:59:32 2013 +0200

    return NULL instead of abort for C99 vsnprintf()<0
    
    Change-Id: I450c2369fdd2327a0b565d6c111b2d03679bed3f

diff --git a/liblangtag/liblangtag-0.5.1-vsnprintf.patch b/liblangtag/liblangtag-0.5.1-vsnprintf.patch
index 8ca5c6e..599c47f 100644
--- a/liblangtag/liblangtag-0.5.1-vsnprintf.patch
+++ b/liblangtag/liblangtag-0.5.1-vsnprintf.patch
@@ -1,12 +1,18 @@
-diff -ru langtag.orig/liblangtag/lt-utils.c langtag/liblangtag/lt-utils.c
---- UnpackedTarball/langtag.orig/liblangtag/lt-utils.c	2013-04-22 10:06:57.000000000 +0200
-+++ UnpackedTarball/langtag/liblangtag/lt-utils.c	2013-04-26 17:58:39.817351779 +0200
-@@ -168,6 +168,8 @@
- 		va_copy(ap, args);
- 
- 		size = vsnprintf(&c, 1, format, ap) + 1;
-+		if (size == 0)  // -1 + 1
-+			abort();
+diff -ru UnpackedTarball/orig.langtag/liblangtag/lt-utils.c UnpackedTarball/langtag/liblangtag/lt-utils.c
+--- UnpackedTarball/orig.langtag/liblangtag/lt-utils.c	2013-07-19 16:47:20.310734230 +0200
++++ UnpackedTarball/langtag/liblangtag/lt-utils.c	2013-07-19 16:53:10.839914271 +0200
+@@ -173,9 +173,11 @@
  
  		va_end(ap);
  
+-		retval = malloc(sizeof (char) * size);
+-		if (retval) {
+-			vsprintf(retval, format, args);
++		if (size > 0) {
++			retval = malloc(sizeof (char) * size);
++			if (retval) {
++				vsprintf(retval, format, args);
++			}
+ 		}
+ 	} LT_STMT_END;
+ #elif HAVE_VSNPRINTF


More information about the Libreoffice-commits mailing list