]> git.eshelyaron.com Git - emacs.git/commitdiff
(image-jpeg-p): Don't search beyond length of data.
authorJohn Paul Wallington <jpw@pobox.com>
Tue, 26 Aug 2003 15:38:36 +0000 (15:38 +0000)
committerJohn Paul Wallington <jpw@pobox.com>
Tue, 26 Aug 2003 15:38:36 +0000 (15:38 +0000)
lisp/ChangeLog
lisp/image.el

index 495fc5fa36ef26481c2df9ed4553c40b722b508f..334d3bd462e927ef651a3106e4e5d81cdcc30a47 100644 (file)
@@ -1,3 +1,7 @@
+2003-08-26  John Paul Wallington  <jpw@gnu.org>
+
+       * image.el (image-jpeg-p): Don't search beyond length of data.
+
 2003-08-26  Martin Stjernholm  <bug-cc-mode@gnu.org>
 
        * progmodes/cc-cmds.el (c-electric-brace): Work around for a
index 25d05c9902fcaf95ecff282db0730cf6a92e15b5..5f603ccdd12802d8ba12eb9bc136f0bd5acea6fb 100644 (file)
@@ -67,7 +67,8 @@ We accept the tag Exif because that is the same format."
            (when (and (>= code #xe0) (<= code #xef))
              ;; APP0 LEN1 LEN2 "JFIF\0"
              (throw 'jfif
-                    (string-match "JFIF\\|Exif" (substring data i (+ i nbytes)))))
+                    (string-match "JFIF\\|Exif"
+                                  (substring data i (min (+ i nbytes) len)))))
            (setq i (+ i 1 nbytes))))))))