Re: ksh: fix buffer overflow in u64ton

2018-04-12 Thread Scott Cheloha
On Mon, Apr 09, 2018 at 08:56:28PM +0200, Tobias Stoeckmann wrote: > As tb@ pointed out, u64ton can overflow on ULONG_MAX. It could also > happen on systems with 64 bit int and INT_MIN, although we don't have > such a system supported by our code base. > > You can reach the u64ton function by prin

Re: ksh: fix buffer overflow in u64ton

2018-04-09 Thread Theo Buehler
On Mon, Apr 09, 2018 at 08:56:28PM +0200, Tobias Stoeckmann wrote: > As tb@ pointed out, u64ton can overflow on ULONG_MAX. It could also > happen on systems with 64 bit int and INT_MIN, although we don't have > such a system supported by our code base. > > You can reach the u64ton function by prin

ksh: fix buffer overflow in u64ton

2018-04-09 Thread Tobias Stoeckmann
As tb@ pointed out, u64ton can overflow on ULONG_MAX. It could also happen on systems with 64 bit int and INT_MIN, although we don't have such a system supported by our code base. You can reach the u64ton function by printing the length of a string within a variable like this: $ a=string $ echo $