Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: I think I found a serious bug in zstrtoul_underscore



On 11/5/2022 4:57 PM, Clinton Bunch wrote:
This is how I'm calling it:

if (!zstrtoul_underscore(OPT_ARG(ops, 'L'), &lower)) {

lower is declared as a zulong.

When fed a negative number it seg faults, on Rocky Linux 8 at least.

Example:

helikon[~/tmp/zsh]% getrandom -L 0 -U $(( 2**32-1))
Test before convert -L
Test after convert -L
377689410
helikon[~/tmp/zsh]% getrandom -L -1 -U 5
Test before convert -L
zsh: segmentation fault (core dumped)  ~/local/bin/zsh


I've verified this on FreeBSD 13.1 and Solaris 11.4 as well, so unless I'm calling it wrong, this seems like a serious bug.





Messages sorted by: Reverse Date, Date, Thread, Author