Skip to content

Commit

Permalink
locale.c: Use out-of-bounds value for illegality
Browse files Browse the repository at this point in the history
This was using 0 as a parameter, which is a legal value and could have
been confused by the called subroutine as being legitimate.  It is not a
bug because of the way the subroutine is currently written given the
other parameters in this call.  But it is more robust to use an
out-of-bounds value, so that if the function were to change, we would
sooner find out about any improper call.
  • Loading branch information
khwilliamson committed Nov 20, 2023
1 parent e98c896 commit 981275f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion locale.c
Expand Up @@ -5744,7 +5744,7 @@ S_my_localeconv(pTHX_ const int item)
if (UTF8NESS_YES == (get_locale_string_utf8ness_i(SvPVX(*value),
LOCALE_IS_UTF8,
NULL,
(locale_category_index) 0)))
LC_ALL_INDEX_ /* OOB */)))
{
SvUTF8_on(*value);
}
Expand Down

0 comments on commit 981275f

Please sign in to comment.