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:
parent
8748ffeaa7
commit
060e305adc
1 changed files with 1 additions and 0 deletions
|
@ -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++;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue