mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Avoid panics for empty or multibyte image usemap
This commit is contained in:
parent
c83ac31e71
commit
ee310fdc2a
3 changed files with 33 additions and 0 deletions
|
@ -422,6 +422,11 @@ impl HTMLImageElement {
|
|||
};
|
||||
|
||||
let value = usemap_attr.value();
|
||||
|
||||
if value.len() == 0 || !value.is_char_boundary(1) {
|
||||
return None
|
||||
}
|
||||
|
||||
let (first, last) = value.split_at(1);
|
||||
|
||||
if first != "#" || last.len() == 0 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue