Skip to content

Commit

Permalink
Fix non-base64 data URLs with % characters not followed by hex digits
Browse files Browse the repository at this point in the history
When writing accumulated "non-special" characters, `slice_start` must be
updated as some later conditionals/patter matches don't update it like
the case when `%` is not followed by 2 hex digits.

This fixes servo#795
  • Loading branch information
SmaugPool committed Oct 2, 2022
1 parent 359bc90 commit 6e37429
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions data-url/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ where
// before this special byte
if i > slice_start {
write_bytes(&bytes[slice_start..i])?;
slice_start = i;
}
// Then deal with the special byte.
match byte {
Expand Down

0 comments on commit 6e37429

Please sign in to comment.