diff options
author | Karl Williamson <khw@cpan.org> | 2021-05-13 11:50:44 -0600 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2021-05-28 07:00:14 -0600 |
commit | 1e870beca985cb6a4dbf3d59bc34b4a36b7280b1 (patch) | |
tree | 99722bd71aefd584b5c9850e0c9a057624818198 /inline.h | |
parent | e5b416634d0055def68bf629b50aea1f831efda2 (diff) | |
download | perl-1e870beca985cb6a4dbf3d59bc34b4a36b7280b1.tar.gz |
isUTF8_CHAR() Check ptr before dereferencing
It is legal to call this function, though not so done in core, with
empty input. By swapping two conditions in the same 'if', we check if
empty before trying to access it.
Diffstat (limited to 'inline.h')
-rw-r--r-- | inline.h | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -1140,7 +1140,7 @@ Perl_isUTF8_CHAR(const U8 * const s0, const U8 * const e) #if defined(UV_IS_QUAD) || defined(EBCDIC) - if (NATIVE_UTF8_TO_I8(*s0) == 0xFF && e - s0 >= UTF8_MAXBYTES) { + if (e - s0 >= UTF8_MAXBYTES && NATIVE_UTF8_TO_I8(*s0) == 0xFF) { return is_utf8_char_helper(s0, e, 0); } |