Add mingw_bindir to /usr/lib64/qt-3.3/bin:/usr/kerberos/bin:/usr/local/bin:/bin:...
[fedora-mingw.git] / libjpeg / libjpeg-buf-oflo.patch
1 Dike out a section of code that has no usefulness on Unix-like systems,
2 and will crash if fed a comment string exceeding 64K.  Per report from
3 Lubomir Kundrak, RH bug #226965
4
5
6 diff -Naur jpeg-6b.orig/wrjpgcom.c jpeg-6b/wrjpgcom.c
7 --- jpeg-6b.orig/wrjpgcom.c     1997-10-23 00:47:03.000000000 -0400
8 +++ jpeg-6b/wrjpgcom.c  2007-06-25 22:26:42.000000000 -0400
9 @@ -446,6 +446,8 @@
10      } else if (keymatch(arg, "comment", 1)) {
11        if (++argn >= argc) usage();
12        comment_arg = argv[argn];
13 +#if 0
14 +#error "There is a buffer overflow in the code below"
15        /* If the comment text starts with '"', then we are probably running
16         * under MS-DOG and must parse out the quoted string ourselves.  Sigh.
17         */
18 @@ -466,6 +468,7 @@
19           strcat(comment_arg, argv[argn]);
20         }
21        }
22 +#endif
23        comment_length = (unsigned int) strlen(comment_arg);
24      } else
25        usage();