mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-20 19:50:24 +02:00
Fix buffer over-read in port encoding scan.
* libguile/read.c (scm_i_scan_for_encoding): Add a NULL terminator to the end of header to prevent over-read by subsequent call to strstr.
This commit is contained in:
parent
16f0612864
commit
f25e1b6713
1 changed files with 1 additions and 0 deletions
|
@ -1646,6 +1646,7 @@ scm_i_scan_for_encoding (SCM port)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
bytes_read = scm_c_read (port, header, SCM_ENCODING_SEARCH_SIZE);
|
bytes_read = scm_c_read (port, header, SCM_ENCODING_SEARCH_SIZE);
|
||||||
|
header[bytes_read] = NULL;
|
||||||
|
|
||||||
scm_seek (port, scm_from_int (0), scm_from_int (SEEK_SET));
|
scm_seek (port, scm_from_int (0), scm_from_int (SEEK_SET));
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue