bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] base32, base64: prefer signed to unsigned integers


From: Bruno Haible
Subject: Re: [PATCH] base32, base64: prefer signed to unsigned integers
Date: Sun, 29 Aug 2021 20:36:16 +0200

Paul Eggert wrote:
> > IMO, it would be better to have code like this in base64_encode_alloc:
> > 
> >   if (inlen < 0)
> >     /* This argument is invalid, since the API change from 2021-08-28.  */
> >     abort ();
> 
> Another possibility would be to treat inlen < 0 the same as integer 
> overflow. I could go either way.

Yes, either an abort() or an integer overflow return indicator would be better
than undefined behaviour, for something that was defined behaviour until last
week.

Bruno






reply via email to

[Prev in Thread] Current Thread [Next in Thread]