1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-20 11:40:18 +02:00

Avoid string buffer overrun in scm_scan_for_encoding

* libguile/read.c (scm_scan_for_encoding): possible overrun if
  coding declaration is at end of file
This commit is contained in:
Michael Gran 2009-09-05 11:10:07 -07:00
parent 8748ffeaa7
commit 060e305adc

View file

@ -1446,6 +1446,7 @@ scm_scan_for_encoding (SCM port)
/* grab the next token */
i = 0;
while (pos + i - header <= SCM_ENCODING_SEARCH_SIZE
&& pos + i - header < bytes_read
&& (isalnum((int) pos[i]) || pos[i] == '_' || pos[i] == '-'
|| pos[i] == '.'))
i++;