[poppler] poppler/goo: gmem.c,1.4,1.5

Kristian Høgsberg krh at kemper.freedesktop.org
Tue Feb 28 12:00:00 PST 2006


Update of /cvs/poppler/poppler/goo
In directory kemper:/tmp/cvs-serv22635/goo

Modified Files:
	gmem.c 
Log Message:
2006-02-28  Kristian Høgsberg  <krh at redhat.com>

        * goo/gmem.c: (gmalloc), (grealloc):
        * poppler/JBIG2Stream.cc:
        * poppler/Stream.cc:
        * poppler/Stream.h:
        * splash/SplashXPathScanner.cc:

        More integer overflow fixes from Derek Noonburg (#5922).



Index: gmem.c
===================================================================
RCS file: /cvs/poppler/poppler/goo/gmem.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- gmem.c	28 Aug 2005 09:43:18 -0000	1.4
+++ gmem.c	28 Feb 2006 19:59:58 -0000	1.5
@@ -11,6 +11,7 @@
 #include <stdlib.h>
 #include <stddef.h>
 #include <string.h>
+#include <limits.h>
 #include "gmem.h"
 
 #ifdef DEBUG_MEM
@@ -63,7 +64,7 @@
   int lst;
   unsigned long *trl, *p;
 
-  if (size == 0)
+  if (size <= 0)
     return NULL;
   size1 = gMemDataSize(size);
   if (!(mem = (char *)malloc(size1 + gMemHdrSize + gMemTrlSize))) {
@@ -86,7 +87,7 @@
 #else
   void *p;
 
-  if (size == 0)
+  if (size <= 0)
     return NULL;
   if (!(p = malloc(size))) {
     fprintf(stderr, "Out of memory\n");
@@ -102,7 +103,7 @@
   void *q;
   size_t oldSize;
 
-  if (size == 0) {
+  if (size <= 0) {
     if (p)
       gfree(p);
     return NULL;
@@ -120,7 +121,7 @@
 #else
   void *q;
 
-  if (size == 0) {
+  if (size <= 0) {
     if (p)
       free(p);
     return NULL;



More information about the poppler mailing list