Re: base64 b64_pton fix

2013-12-30 Thread Ted Unangst
On Thu, Dec 26, 2013 at 05:17, Todd C. Miller wrote: > This is nit picking but it bugs me to see the conditional repeated > like that. Perhaps instead of: > > if (nextbyte && tarindex + 1 >= targsize) > return (-1); > if (tarindex + 1 < targsize) > target[tarindex+1] = nextbyte; > > Something mo

Re: base64 b64_pton fix

2013-12-26 Thread Todd C. Miller
This is nit picking but it bugs me to see the conditional repeated like that. Perhaps instead of: if (nextbyte && tarindex + 1 >= targsize) return (-1); if (tarindex + 1 < targsize) target[tarindex+1] = nextbyte; Something more like: if (tarindex + 1 < targsize) {

Re: base64 b64_pton fix

2013-12-24 Thread Gilles Chehade
On Mon, Dec 23, 2013 at 02:49:45PM -0500, Ted Unangst wrote: > be afraid, be very afraid... > b > If you base64 encode a buffer that's not a nice multiple of 3, you get > padding (=) bytes. When you decode those padding bytes, you should > get back a correctly sized buffer, but b64_pton doe

base64 b64_pton fix

2013-12-23 Thread Ted Unangst
be afraid, be very afraid... If you base64 encode a buffer that's not a nice multiple of 3, you get padding (=) bytes. When you decode those padding bytes, you should get back a correctly sized buffer, but b64_pton doesn't quite know this. It tries to write past the end sometimes. Test string bel