aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2025-06-25 14:05:38 -0400
committerDavid Robillard <d@drobilla.net>2025-06-25 21:05:42 -0400
commit5a512e57bc80503a20372ba328ec2bba72a00d96 (patch)
treeb649dcbb6b240d1003aeaa7d3c7556395a29ef5e
parent03809f07159eaa0f7a0077701f6346550ae22d6e (diff)
downloadlv2-5a512e57bc80503a20372ba328ec2bba72a00d96.tar.xz
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.
-rw-r--r--plugins/eg-scope.lv2/examploscope_ui.c4
1 files changed, 4 insertions, 0 deletions
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);
}
/**