diff options
author | Karl Williamson <khw@cpan.org> | 2018-03-27 15:49:06 -0600 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2018-03-31 15:36:46 -0600 |
commit | a78c2fa63b9d2e6faac531a43f1ef9e09eb25d9b (patch) | |
tree | 933232109f02e62293ec490641a1a3697e447775 /proto.h | |
parent | 4d3d8522adb2df78f6a8713029eb6b13b41094d9 (diff) | |
download | perl-a78c2fa63b9d2e6faac531a43f1ef9e09eb25d9b.tar.gz |
regexec.c: Check for UTF-8 fitting
We've been burned before by malformed UTF-8 causing us to read outside
the buffer bounds. Here is a case I saw during code inspection, and
it's easy to add the buffer end limit
Diffstat (limited to 'proto.h')
-rw-r--r-- | proto.h | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -5620,10 +5620,10 @@ STATIC U8 * S_find_span_end_mask(U8 * s, const U8 * send, const U8 span_byte, co #define PERL_ARGS_ASSERT_FIND_SPAN_END_MASK \ assert(s); assert(send) -STATIC bool S_isFOO_utf8_lc(pTHX_ const U8 classnum, const U8* character) +STATIC bool S_isFOO_utf8_lc(pTHX_ const U8 classnum, const U8* character, const U8* e) __attribute__warn_unused_result__; #define PERL_ARGS_ASSERT_ISFOO_UTF8_LC \ - assert(character) + assert(character); assert(e) STATIC bool S_isGCB(pTHX_ const GCB_enum before, const GCB_enum after, const U8 * const strbeg, const U8 * const curpos, const bool utf8_target) __attribute__warn_unused_result__; |