ui: read the signal count under the lock in the badge bar; validate the drop payload

This commit is contained in:
Martino Ferrari committed 2026-11-03 01:53:09 +01:00
1 parent 5242babf99
commit dad424f1de
3 files changed
+20 -5

No files matched your search

+5 -1
View File
@@ -557,7 +557,11 @@ gboolean on_drop_channel(GtkDropTarget*, const GValue* value, double x, double y
// Where the drop landed decides the row: one area covers them all.
const int row = row_at(*app, x, y);
const char* text = g_value_get_string(value);
const std::size_t signal = static_cast<std::size_t>(std::atoll(text ? text : "0"));
if (text == nullptr || *text == '\0') return FALSE;
char* end = nullptr;
const unsigned long long parsed = std::strtoull(text, &end, 10);
if (end == nullptr || *end != '\0') return FALSE;
const std::size_t signal = static_cast<std::size_t>(parsed);
if (!assign_signal_to_row(*app, signal, row)) return FALSE;
cancel_drag_on(*app, row);
return TRUE;