summaryrefslogtreecommitdiffstats
path: root/generic/tkPanedWindow.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2022-05-08 19:49:02 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2022-05-08 19:49:02 (GMT)
commitb6b0977b82acc2b5e001aa7ba67e1b504757995c (patch)
tree0e0d93cba3a08d4612d3fb7a59989da2d0ca39c1 /generic/tkPanedWindow.c
parent89e3f088ee7a864f5034e4e88615c248dea16821 (diff)
downloadtk-b6b0977b82acc2b5e001aa7ba67e1b504757995c.zip
tk-b6b0977b82acc2b5e001aa7ba67e1b504757995c.tar.gz
tk-b6b0977b82acc2b5e001aa7ba67e1b504757995c.tar.bz2
Fix [0ce975c57]: memcpy() called with pwPtr->panes == NULL
Diffstat (limited to 'generic/tkPanedWindow.c')
-rw-r--r--generic/tkPanedWindow.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/generic/tkPanedWindow.c b/generic/tkPanedWindow.c
index c59d458..14652bb 100644
--- a/generic/tkPanedWindow.c
+++ b/generic/tkPanedWindow.c
@@ -1016,9 +1016,11 @@ ConfigurePanes(
* If none of the existing panes have to be moved, just copy the old
* and append the new.
*/
- memcpy((void *)&(newPanes[0]), pwPtr->panes,
- sizeof(Pane *) * pwPtr->numPanes);
- memcpy((void *)&(newPanes[pwPtr->numPanes]), inserts,
+ if (pwPtr->numPanes) {
+ memcpy(newPanes, pwPtr->panes,
+ sizeof(Pane *) * pwPtr->numPanes);
+ }
+ memcpy(&newPanes[pwPtr->numPanes], inserts,
sizeof(Pane *) * numNewPanes);
} else {
/*
@@ -1037,7 +1039,7 @@ ConfigurePanes(
}
}
- memcpy((void *)&(newPanes[j]), inserts, sizeof(Pane *)*insertIndex);
+ memcpy(&newPanes[j], inserts, sizeof(Pane *)*insertIndex);
j += firstOptionArg - 2;
for (i = index; i < pwPtr->numPanes; i++) {