diff options
author | Karl Williamson <khw@cpan.org> | 2019-03-13 11:42:15 -0600 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2019-03-13 15:42:49 -0600 |
commit | 6dd641e14cd2675068749eeea8c8aabee158595e (patch) | |
tree | 5c987b571ade9a22baf5173676c493e05809c598 /dquote.c | |
parent | 85fcc8f2234ce65ebd31480efc38dc4a3ec8ad13 (diff) | |
download | perl-6dd641e14cd2675068749eeea8c8aabee158595e.tar.gz |
dquote.c: Use UTF8_SAFE_SKIP
Otherwise malformed input could cause this to return a pointer outside
its buffer
Diffstat (limited to 'dquote.c')
-rw-r--r-- | dquote.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -141,7 +141,7 @@ Perl_grok_bslash_o(pTHX_ char **s, const char * const send, UV *uv, if (numbers_len != (STRLEN) (e - *s)) { if (strict) { *s += numbers_len; - *s += (UTF) ? UTF8SKIP(*s) : (STRLEN) 1; + *s += (UTF) ? UTF8_SAFE_SKIP(*s, send) : 1; *error_msg = "Non-octal character"; return FALSE; } @@ -223,7 +223,7 @@ Perl_grok_bslash_x(pTHX_ char **s, const char * const send, UV *uv, *s += len; if (strict && len != 2) { if (len < 2) { - *s += (UTF) ? UTF8SKIP(*s) : 1; + *s += (UTF) ? UTF8_SAFE_SKIP(*s, send) : 1; *error_msg = "Non-hex character"; } else { @@ -272,7 +272,7 @@ Perl_grok_bslash_x(pTHX_ char **s, const char * const send, UV *uv, if (strict && numbers_len != (STRLEN) (e - *s)) { *s += numbers_len; - *s += (UTF) ? UTF8SKIP(*s) : 1; + *s += (UTF) ? UTF8_SAFE_SKIP(*s, send) : 1; *error_msg = "Non-hex character"; return FALSE; } |