From: Paul Eggert Date: Mon, 4 Apr 2011 07:48:36 +0000 (-0700) Subject: * lread.c (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop. X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1^2~5^2~844^2~1983^2~34 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=e6eb4e9e0471c66eddaece34a90ce0e882a7e747;p=emacs.git * lread.c (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop. --- diff --git a/src/ChangeLog b/src/ChangeLog index ee955245452..a83f79ef2de 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -2,6 +2,7 @@ * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs. (lisp_file_lexically_bound_p, read1): Use unsigned instead of int. + (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop. * print.c (print_error_message): Avoid int overflow. diff --git a/src/lread.c b/src/lread.c index fb5b6cd0136..8777bc34545 100644 --- a/src/lread.c +++ b/src/lread.c @@ -907,7 +907,7 @@ safe_to_load_p (int fd) if (i == 4) version = buf[i]; - if (i == nbytes + if (i >= nbytes || fast_c_string_match_ignore_case (Vbytecomp_version_regexp, buf + i) < 0) safe_p = 0;