mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-20 03:30:27 +02:00
Fix open-file mode misinterpretation
* libguile/fports.c (scm_i_mode_to_open_flags): Validate that argument is string. Fixes #25498.
This commit is contained in:
parent
24eea1be08
commit
82ea7c763b
1 changed files with 3 additions and 0 deletions
|
@ -159,6 +159,9 @@ scm_i_mode_to_open_flags (SCM mode, int *is_binary, const char *FUNC_NAME)
|
|||
int flags = 0;
|
||||
const char *md, *ptr;
|
||||
|
||||
if (SCM_UNLIKELY (!scm_is_string (mode)))
|
||||
scm_out_of_range (FUNC_NAME, mode);
|
||||
|
||||
if (SCM_UNLIKELY (!scm_i_try_narrow_string (mode)))
|
||||
scm_out_of_range (FUNC_NAME, mode);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue