cvs: gd /libgd ISSUES gdcache.c

[email protected] ("Pierre-Alain Joye")
Newsgroups php.gd.cvs
Message-ID <cvspajoye1167857412@cvsserver>
pajoye		Wed Jan  3 20:50:12 2007 UTC

  Modified files:              
    /gd/libgd	gdcache.c ISSUES 
  Log:
  #25, Added sanity checks for possible allocation failures in gdCacheCreate
       and main
  
  
http://cvs.php.net/viewvc.cgi/gd/libgd/gdcache.c?r1=1.6&r2=1.7&diff_format=u
Index: gd/libgd/gdcache.c
diff -u gd/libgd/gdcache.c:1.6 gd/libgd/gdcache.c:1.7
--- gd/libgd/gdcache.c:1.6	Wed Apr  5 15:47:56 2006
+++ gd/libgd/gdcache.c	Wed Jan  3 20:50:12 2007
@@ -71,6 +71,10 @@
   gdCache_head_t *head;
 
   head = (gdCache_head_t *) gdMalloc (sizeof (gdCache_head_t));
+	if (!head) {
+		return NULL;
+	}
+
   head->mru = NULL;
   head->size = size;
   head->gdCacheTest = gdCacheTest;
@@ -195,6 +199,9 @@
   int elem, key;
 
   cacheTable = gdCacheCreate (3, cacheTest, cacheFetch, cacheRelease);
+	if (!cacheTable) {
+		exit(1);
+	}
 
   key = 20;
   elem = *(int *) gdCacheGet (cacheTable, &key);
http://cvs.php.net/viewvc.cgi/gd/libgd/ISSUES?r1=1.22&r2=1.23&diff_format=u
Index: gd/libgd/ISSUES
diff -u gd/libgd/ISSUES:1.22 gd/libgd/ISSUES:1.23
--- gd/libgd/ISSUES:1.22	Wed Jan  3 20:45:58 2007
+++ gd/libgd/ISSUES	Wed Jan  3 20:50:12 2007
@@ -44,6 +44,8 @@
 #20, Fixed gdImageCopyMergeGray when used with a true color image
 #21, gdImageCopyResized sanity check for allocation failures
 #22, Fixed transparency preservation in gdImageCopyRotated 
-#23,  Added sanity checks  for possible allocation failures in 
+#23, Added sanity checks for possible allocation failures in 
       gdImageFilledPolygon and gdImageSetStyle
-#24,  Out of range checks in gdImageSetAAPixelColor
+#24, Out of range checks in gdImageSetAAPixelColor
+#25, Added sanity checks for possible allocation failures in gdCacheCreate
+     and main
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.