From: John Paul Wallington Date: Tue, 26 Aug 2003 15:38:36 +0000 (+0000) Subject: (image-jpeg-p): Don't search beyond length of data. X-Git-Tag: ttn-vms-21-2-B4~8978 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=32b3c766421819026320d6429529b6bf9b59f68e;p=emacs.git (image-jpeg-p): Don't search beyond length of data. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 495fc5fa36e..334d3bd462e 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2003-08-26 John Paul Wallington + + * image.el (image-jpeg-p): Don't search beyond length of data. + 2003-08-26 Martin Stjernholm * progmodes/cc-cmds.el (c-electric-brace): Work around for a diff --git a/lisp/image.el b/lisp/image.el index 25d05c9902f..5f603ccdd12 100644 --- a/lisp/image.el +++ b/lisp/image.el @@ -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))))))))