dankamongmen / notcurses

blingful character graphics/TUI library. definitely not curses.
https://nick-black.com/dankwiki/index.php/Notcurses
Other
3.4k stars 113 forks source link

Improved overflow checker code #2767

Closed mulle-nat closed 4 months ago

mulle-nat commented 4 months ago

I think you will like this much better. The other code was more or less a mitigation but this should be a better overflow checker. The multiplication does the zero check and the comparison checks that the multiplication doesn't overflow. calloc will then do the other overflow check.

mulle-nat commented 4 months ago

Not sure why the other commits are in here again. Will try to fix this tomorrow.

dankamongmen commented 4 months ago

i definitely feel the notcurses.c change to be improved (though I thought we'd already merged it? where's my brain these days?)

mulle-nat commented 4 months ago

Closing this as #2768 is the better, mergable of it.