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

I think I found a serious bug in zstrtoul_underscore



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





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