summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2026-01-20 09:51:39 +0100
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2026-01-20 09:51:39 +0100
commit138624fa27bccb15136140a49924f826b77314e8 (patch)
treeffac78154a09337d5ac0907c92febbf71294bb7b
parent61e75e4a12f199368f28dd274d83fc4ecd9cfec3 (diff)
Remove possible NULL dereference introduced at commit 61e75e4
-rw-r--r--src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx b/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx
index 3816dff2c..c9774f895 100644
--- a/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx
+++ b/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx
@@ -1017,8 +1017,10 @@ void text_input_commit_string(void *data, struct zwp_text_input_v3 *zwp_text_inp
const char *text) {
//printf("text_input_commit_string %s\n",text);
free(pending_commit);
- pending_commit = text ? strdup(text) : NULL;
- fl_utf8_remove_context_dependent(pending_commit, strlen(pending_commit));
+ if (text) {
+ pending_commit = strdup(text);
+ fl_utf8_remove_context_dependent(pending_commit, strlen(pending_commit));
+ } else pending_commit = NULL;
}