Skip to content

Commit

Permalink
utf8_hop_back: Check before derefencing
Browse files Browse the repository at this point in the history
This conditional derefenced before checking if it is safe to dereference
  • Loading branch information
khwilliamson committed Jul 17, 2023
1 parent a5fea3d commit ef4802e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion inline.h
Expand Up @@ -2150,7 +2150,7 @@ Perl_utf8_hop_back(const U8 *s, SSize_t off, const U8 *start)
while (off++ && s > start) {
do {
s--;
} while (UTF8_IS_CONTINUATION(*s) && s > start);
} while (s > start && UTF8_IS_CONTINUATION(*s));
}

GCC_DIAG_IGNORE(-Wcast-qual)
Expand Down

0 comments on commit ef4802e

Please sign in to comment.