From 5a512e57bc80503a20372ba328ec2bba72a00d96 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 25 Jun 2025 14:05:38 -0400 Subject: Reset forge buffer to avoid potential escape of stack pointers This shouldn't be an issue in practice, but avoids a potential mistake if the forge was to be used again without being properly reset, which clang-tidy 20 gained the ability to recognize. --- plugins/eg-scope.lv2/examploscope_ui.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/eg-scope.lv2/examploscope_ui.c b/plugins/eg-scope.lv2/examploscope_ui.c index 50b8f4c..4f366aa 100644 --- a/plugins/eg-scope.lv2/examploscope_ui.c +++ b/plugins/eg-scope.lv2/examploscope_ui.c @@ -110,6 +110,8 @@ send_ui_state(LV2UI_Handle handle) lv2_atom_total_size(msg), ui->uris.atom_eventTransfer, msg); + + lv2_atom_forge_set_buffer(&ui->forge, NULL, 0); } /** Notify backend that UI is closed. */ @@ -134,6 +136,8 @@ send_ui_disable(LV2UI_Handle handle) lv2_atom_total_size(msg), ui->uris.atom_eventTransfer, msg); + + lv2_atom_forge_set_buffer(&ui->forge, NULL, 0); } /** -- cgit v1.2.1