summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas E. Dickey <dickey@invisible-island.net>2024-03-01 20:31:43 -0500
committerThomas E. Dickey <dickey@invisible-island.net>2024-03-02 16:58:23 -0500
commit28b5ce87555b5c85f240895c64818015d134b3b7 (patch)
tree2ae05ed4d33706523d3cb5aa41526a43233b2799
parent96e4ac3ae1afdeafb16ea0e147364d15e7bfd549 (diff)
add check for null pointer, avoid dereferencing
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
-rw-r--r--src/SimpleMenu.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/SimpleMenu.c b/src/SimpleMenu.c
index 0405747..744d6c9 100644
--- a/src/SimpleMenu.c
+++ b/src/SimpleMenu.c
@@ -1073,7 +1073,9 @@ CreateLabel(Widget w)
*next_child = *child;
next_child = child;
}
- *child = (Widget)smw->simple_menu.label;
+
+ if (child != NULL)
+ *child = (Widget)smw->simple_menu.label;
}
/*