Alejandro Colomar wrote:
> If xstrtol() was being called with a base of 1, under some conditions it
> would invoke Undefined Behavior.

Yes, sure. A numeric base of 1 makes no sense, mathematically.

Thanks for the patch; applied.

Note that I disagree with the statement from
https://github.com/void-linux/void-packages/issues/51261#issuecomment-2237055195
 :
> Yet he introduced that bug a decade ago

I wouldn't call it a bug. Gnulib does not document that passing a base of 1
to xstrtol is valid. It's known to everyone in the field that a base of 1
makes no sense. So, what you saw here was a slightly incomplete input
validation check.

Thanks for the improvement.

Bruno




Reply via email to