diff options
author | John Paul Wallington <jpw@pobox.com> | 2003-08-26 15:38:36 +0000 |
---|---|---|
committer | John Paul Wallington <jpw@pobox.com> | 2003-08-26 15:38:36 +0000 |
commit | 32b3c766421819026320d6429529b6bf9b59f68e (patch) | |
tree | 0c89a687e52c8724ab36e071444791ba4a4a9784 /lisp/image.el | |
parent | c577b2225a8c8e84be77822e30c2d739b699c471 (diff) | |
download | emacs-32b3c766421819026320d6429529b6bf9b59f68e.tar.gz |
(image-jpeg-p): Don't search beyond length of data.
Diffstat (limited to 'lisp/image.el')
-rw-r--r-- | lisp/image.el | 3 |
1 files changed, 2 insertions, 1 deletions
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)))))))) |