summaryrefslogtreecommitdiff
path: root/dquote.c
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2019-03-13 11:42:15 -0600
committerKarl Williamson <khw@cpan.org>2019-03-13 15:42:49 -0600
commit6dd641e14cd2675068749eeea8c8aabee158595e (patch)
tree5c987b571ade9a22baf5173676c493e05809c598 /dquote.c
parent85fcc8f2234ce65ebd31480efc38dc4a3ec8ad13 (diff)
downloadperl-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.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/dquote.c b/dquote.c
index 6913ca5ce4..10fb2b5df0 100644
--- a/dquote.c
+++ b/dquote.c
@@ -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;
}