diff options
author | Thomas E. Dickey <dickey@invisible-island.net> | 2024-03-01 20:31:26 -0500 |
---|---|---|
committer | Thomas E. Dickey <dickey@invisible-island.net> | 2024-03-02 16:58:18 -0500 |
commit | 96e4ac3ae1afdeafb16ea0e147364d15e7bfd549 (patch) | |
tree | 4f18077d1c89efea8f546017b4484490a1b8d992 | |
parent | 5815fc38a12e5ac7f8bd391ce8f04f13b8178e69 (diff) |
add check for null pointer, avoid dereferencing
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
-rw-r--r-- | src/Paned.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/Paned.c b/src/Paned.c index 59ce1a8..c7bc71c 100644 --- a/src/Paned.c +++ b/src/Paned.c @@ -1125,11 +1125,17 @@ MoveGripAdjustment(PanedWidget pw, Widget grip, Direction dir, int loc) if (dir == ThisBorderOnly) { int old_add_size = add_size, old_sub_size; + if (pw->paned.whichadd == NULL) + return; + AssignMax(add_size, (int)PaneInfo(pw->paned.whichadd)->min); AssignMin(add_size, (int)PaneInfo(pw->paned.whichadd)->max); if (add_size != old_add_size) sub_size += old_add_size - add_size; + if (pw->paned.whichsub == NULL) + return; + old_sub_size = sub_size; AssignMax(sub_size, (int)PaneInfo(pw->paned.whichsub)->min); AssignMin(sub_size, (int)PaneInfo(pw->paned.whichsub)->max); |