mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-21 04:00:19 +02:00
Incorrect indexing into character name list
When converting a character into a character name, an incorrect character name could theoretically have been returned. * libguile/chars.c (scm_i_charname): used wrong index into scm_alt_charnames
This commit is contained in:
parent
3323ec063c
commit
b349875146
1 changed files with 3 additions and 1 deletions
|
@ -577,9 +577,11 @@ scm_i_charname (SCM chr)
|
||||||
if (scm_C0_control_charnums[c] == i)
|
if (scm_C0_control_charnums[c] == i)
|
||||||
return scm_C0_control_charnames[c];
|
return scm_C0_control_charnames[c];
|
||||||
|
|
||||||
|
/* Since the characters in scm_alt_charnums is a subset of
|
||||||
|
scm_C0_control_charnums, this code is never reached. */
|
||||||
for (c = 0; c < SCM_N_ALT_CHARNAMES; c++)
|
for (c = 0; c < SCM_N_ALT_CHARNAMES; c++)
|
||||||
if (scm_alt_charnums[c] == i)
|
if (scm_alt_charnums[c] == i)
|
||||||
return scm_alt_charnames[i];
|
return scm_alt_charnames[c];
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue