diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2022-05-08 19:49:02 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2022-05-08 19:49:02 (GMT) |
commit | b6b0977b82acc2b5e001aa7ba67e1b504757995c (patch) | |
tree | 0e0d93cba3a08d4612d3fb7a59989da2d0ca39c1 /generic/tkPanedWindow.c | |
parent | 89e3f088ee7a864f5034e4e88615c248dea16821 (diff) | |
download | tk-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.c | 10 |
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++) { |