mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-19 14:01:10 +01:00
In hb-gpu-web and hb-gpu-web-webgpu, rebuild_buffer() frees current_text after duplicating the input text, but then passes the original text pointer to demo_buffer_add_text(). When called from web_load_font(), web_set_variations(), web_set_features(), or web_set_palette() with custom text active, text aliases current_text, resulting in a use-after-free read of recently freed heap memory. Fix this by: 1. Skipping redundant reallocation when text already equals current_text. 2. Passing current_text to demo_buffer_add_text(). 3. Handling a null text input safely with a default fallback. Assisted-by: Gemini