diff options
author | fvogel <fvogelnew1@free.fr> | 2020-09-08 19:47:11 (GMT) |
---|---|---|
committer | fvogel <fvogelnew1@free.fr> | 2020-09-08 19:47:11 (GMT) |
commit | 1cebfa6aa3095dcdb4dbcf81186a0090a5ef2b8b (patch) | |
tree | 481c22acf0b033dc02db8f05a1badbc0273f918e /generic/tkConfig.c | |
parent | a56a753b41381943366da4d0bfbe307b14ad3eb6 (diff) | |
download | tk-1cebfa6aa3095dcdb4dbcf81186a0090a5ef2b8b.zip tk-1cebfa6aa3095dcdb4dbcf81186a0090a5ef2b8b.tar.gz tk-1cebfa6aa3095dcdb4dbcf81186a0090a5ef2b8b.tar.bz2 |
Fix [6c2425f92e]: UBSan error in Tk_FreeSavedOptions(). Thanks to Christopher Chavez.
Diffstat (limited to 'generic/tkConfig.c')
-rw-r--r-- | generic/tkConfig.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/generic/tkConfig.c b/generic/tkConfig.c index a752674..7e0943d 100644 --- a/generic/tkConfig.c +++ b/generic/tkConfig.c @@ -1500,9 +1500,8 @@ Tk_FreeSavedOptions( Tk_FreeSavedOptions(savePtr->nextPtr); ckfree(savePtr->nextPtr); } - for (count = savePtr->numItems, - savedOptionPtr = &savePtr->items[savePtr->numItems-1]; - count > 0; count--, savedOptionPtr--) { + for (count = savePtr->numItems; count > 0; count--) { + savedOptionPtr = &savePtr->items[count-1]; if (savedOptionPtr->optionPtr->flags & OPTION_NEEDS_FREEING) { FreeResources(savedOptionPtr->optionPtr, savedOptionPtr->valuePtr, (char *) &savedOptionPtr->internalForm, savePtr->tkwin); |