From 8768143d7e2901e03143a423bc4a127dc4e48f0a Mon Sep 17 00:00:00 2001 From: Tom Schuster Date: Mon, 8 Jul 2024 21:19:08 +0200 Subject: [PATCH] avm2: Throw error for missing end tag in E4X --- core/src/avm2/e4x.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/core/src/avm2/e4x.rs b/core/src/avm2/e4x.rs index 48eaad1bd..69e76bac7 100644 --- a/core/src/avm2/e4x.rs +++ b/core/src/avm2/e4x.rs @@ -979,6 +979,15 @@ impl<'gc> E4XNode<'gc> { Event::Eof => break, } } + + // Throw an error for unclosed tags. + if let Some(current_tag) = open_tags.last() { + return Err(make_error_1085( + activation, + ¤t_tag.local_name().unwrap().to_utf8_lossy(), + )); + } + Ok(top_level) }