diff options
author | Karl Williamson <khw@cpan.org> | 2022-03-05 18:03:23 -0700 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2022-03-05 21:04:39 -0700 |
commit | 286a1bfd696eb9d8dc1fa337234d1512f63beb67 (patch) | |
tree | b57ee2c2909a3187fc1df75f68e2c611cdd1a90c /inline.h | |
parent | 3aea88f20c1f2a8df4a354a54cde01cd642750d9 (diff) | |
download | perl-286a1bfd696eb9d8dc1fa337234d1512f63beb67.tar.gz |
utf8_to_uvchr_buf_helper: Check before deref
*s may not be valid here; check first.
Diffstat (limited to 'inline.h')
-rw-r--r-- | inline.h | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -2532,7 +2532,7 @@ Perl_utf8_to_uvchr_buf_helper(pTHX_ const U8 *s, const U8 *send, STRLEN *retlen) } else { UV ret = utf8n_to_uvchr(s, send - s, retlen, 0); - if (retlen && ret == 0 && *s != '\0') { + if (retlen && ret == 0 && (send <= s || *s != '\0')) { *retlen = (STRLEN) -1; } |