[Frugalware-darcs] frugalware-0.6: gd-2.0.34-2terminus2-i686

voroskoi voroskoi at frugalware.org
Sat Jun 30 14:55:27 CEST 2007


Darcsweb-Url: http://darcs.frugalware.org/darcsweb/darcsweb.cgi?r=frugalware-0.6;a=darcs_commitdiff;h=20070630125335-dd049-30c44356457d4741aaa20548b2216e7e2c0f7266.gz;

[gd-2.0.34-2terminus2-i686
voroskoi <voroskoi at frugalware.org>**20070630125335
 secfix bump, closes #2219
 also fixes a race condition
] {
hunk ./source/lib/gd/FrugalBuild 6
-pkgrel=2terminus1
+pkgrel=2terminus2
hunk ./source/lib/gd/FrugalBuild 13
-source=($url/releases/$pkgname-$pkgver.tar.bz2 gd-2.0.33-secfix.diff CVE-2007-2756.patch)
-sha1sums=('7d735b2917f987dd71ddbb72e9e100b2f8951de7'\
-          'cbb8431bc5ee54452eb968f35e687591f86f9f92'\
-          '78824cc6ecf186c12f3a8d5345a5b69d3f3ee294')
+source=($url/releases/$pkgname-$pkgver.tar.bz2 gd-2.0.33-secfix.diff CVE-2007-2756.patch \
+	SA25855.diff gdImageStringFTEx_race.diff)
+sha1sums=('7d735b2917f987dd71ddbb72e9e100b2f8951de7' \
+          'cbb8431bc5ee54452eb968f35e687591f86f9f92' \
+          '78824cc6ecf186c12f3a8d5345a5b69d3f3ee294' \
+          '74fc302c442c30e4a3d41c42321b51c05a2d08f8' \
+          '6cb1a0284d98071bcd0711195bcc06e4f254fd53')
addfile ./source/lib/gd/SA25855.diff
hunk ./source/lib/gd/SA25855.diff 1
+--- gd/gd.c	2007/05/07 10:26:44	1.57
++++ gd.c	2007/06/09 12:32:25	1.58
+@@ -141,14 +141,25 @@
+ {
+   int i;
+   gdImagePtr im;
++
++  if (overflow2(sx, sy)) {
++    return NULL;
++  }
++
++  if (overflow2(sizeof (int *), sy)) {
++    return 0;
++  }
++
++  if (overflow2(sizeof(int), sx)) {
++    return NULL;
++  }
++
+   im = (gdImage *) gdMalloc (sizeof (gdImage));
+   if (!im) {
+     return 0;
+   }
+   memset (im, 0, sizeof (gdImage));
+-  if (overflow2(sizeof (int *), sy)) {
+-    return 0;
+-  }
++
+   im->tpixels = (int **) gdMalloc (sizeof (int *) * sy);
+   if (!im->tpixels) {
+     gdFree(im);
+--- gd/gd.c	2007/06/17 22:11:20	1.62
++++ gd.c	2007/06/19 20:25:32	1.63
+@@ -2838,6 +2838,10 @@
+     }
+   bytes = (w * h / 8) + 1;
+   im = gdImageCreate (w, h);
++  if (!im) {
++    return 0;
++  }
++
+   gdImageColorAllocate (im, 255, 255, 255);
+   gdImageColorAllocate (im, 0, 0, 0);
+   x = 0;
addfile ./source/lib/gd/gdImageStringFTEx_race.diff
hunk ./source/lib/gd/gdImageStringFTEx_race.diff 1
+diff -u -u -p -r1.28.2.2 gdft.c
+--- gd/gdft.c	7 Feb 2007 00:12:46 -0000	1.28.2.2
++++ gdft.c	26 Feb 2007 19:05:52 -0000
+@@ -217,6 +217,16 @@ static int comp_entities(const void *e1,
+   return strcmp(en1->name, en2->name);
+ }
+ 
++extern int any2eucjp (char *, char *, unsigned int);
++
++/* Persistent font cache until explicitly cleared */
++/* Fonts can be used across multiple images */
++
++/* 2.0.16: thread safety (the font cache is shared) */
++gdMutexDeclare (gdFontCacheMutex);
++static gdCache_head_t *fontCache;
++static FT_Library library;
++
+ #define Tcl_UniChar int
+ #define TCL_UTF_MAX 3
+ static int
+@@ -767,24 +777,16 @@ gdft_draw_bitmap (gdCache_head_t * tc_ca
+ 	      /* find antialised color */
+ 
+ 	      tc_key.bgcolor = *pixel;
++				gdMutexLock(gdFontCacheMutex);
+ 	      tc_elem = (tweencolor_t *) gdCacheGet (tc_cache, &tc_key);
+ 	      *pixel = tc_elem->tweencolor;
++				gdMutexUnlock(gdFontCacheMutex);
+ 	    }
+ 	}
+     }
+   return (char *) NULL;
+ }
+ 
+-extern int any2eucjp (char *, char *, unsigned int);
+-
+-/* Persistent font cache until explicitly cleared */
+-/* Fonts can be used across multiple images */
+-
+-/* 2.0.16: thread safety (the font cache is shared) */
+-gdMutexDeclare (gdFontCacheMutex);
+-static gdCache_head_t *fontCache;
+-static FT_Library library;
+-
+ BGD_DECLARE(void) gdFreeFontCache ()
+ {
+   gdFontCacheShutdown ();
+@@ -794,11 +796,12 @@ BGD_DECLARE(void) gdFontCacheShutdown ()
+ {
+   if (fontCache)
+     {
+-      gdMutexShutdown (gdFontCacheMutex);
++			gdMutexLock(gdFontCacheMutex);
+       gdCacheDelete (fontCache);
+-      FT_Done_FreeType (library);
+       /* 2.0.16: Gustavo Scotti: make sure we don't free this twice */
+       fontCache = 0;
++      gdMutexShutdown (gdFontCacheMutex);
++      FT_Done_FreeType (library);
+     }
+ }
+ 
}


More information about the Frugalware-darcs mailing list