~ubuntu-branches/ubuntu/oneiric/cups/oneiric

« back to all changes in this revision

Viewing changes to debian/patches/00svn_gif_overflow.patch

  • Committer: Package Import Robot
  • Author(s): Martin Pitt
  • Date: 2011-09-27 14:46:38 UTC
  • Revision ID: package-import@ubuntu.com-20110927144638-i5ku2zniedcyxzxt
Tags: 1.5.0-8
* Urgency medium due to security fix. The previous version wasn't in testing
  yet, but already matured for half of the usual period, so it will still
  be 10 days in sum.
* Add 00svn_gif_overflow.patch: Fix heap overflow with broken/crafted GIF
  files. Patch taken from upstream svn. [CVE-2011-3170]

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Description: Fix heap overflow with broken/crafted GIF files. [CVE-2011-3170]
 
2
Origin: http://cups.org/str.php?L3914
 
3
 
 
4
Index: filter/image-gif.c
 
5
===================================================================
 
6
--- a/filter/image-gif.c        (revision 9862)
 
7
+++ b/filter/image-gif.c        (working copy)
 
8
@@ -648,11 +648,13 @@
 
9
 
 
10
     if (code == max_code)
 
11
     {
 
12
-      *sp++ = firstcode;
 
13
-      code  = oldcode;
 
14
+      if (sp < (stack + 8192))
 
15
+       *sp++ = firstcode;
 
16
+
 
17
+      code = oldcode;
 
18
     }
 
19
 
 
20
-    while (code >= clear_code)
 
21
+    while (code >= clear_code && sp < (stack + 8192))
 
22
     {
 
23
       *sp++ = table[1][code];
 
24
       if (code == table[0][code])
 
25
@@ -661,9 +663,11 @@
 
26
       code = table[0][code];
 
27
     }
 
28
 
 
29
-    *sp++ = firstcode = table[1][code];
 
30
-    code  = max_code;
 
31
+    if (sp < (stack + 8192))
 
32
+      *sp++ = firstcode = table[1][code];
 
33
 
 
34
+    code = max_code;
 
35
+
 
36
     if (code < 4096)
 
37
     {
 
38
       table[0][code] = oldcode;