DECR macro signedness

Nikos Mavrogiannopoulos nmav at gnutls.org
Tue Jan 12 09:32:57 CET 2010


I like that change. In my version I had changed the input value to be
signed instead, but it
is better to have a generic macro to avoid issues like that.

regards,
Nikos

On Tue, Jan 12, 2010 at 7:12 AM, Steve Dispensa
<dispensa at phonefactor.com> wrote:
>
> Sorry if this is well known (I suspect it is, based on some of the code),
> but DECR_LEN and friends have an integer underflow problem if they're passed
> unsigned quantities. Spot-checking the code shows that it's generally called
> with signed quantities, but I didn't see any documentation pointing out the
> problem.
>
> Here's a patch if you want it; it uses the C99 intmax_t type to make a
> signed copy of the potentially unsigned argument for the negativity test.
>
> Apologies if this is old news.
>
>  -Steve
>
> _______________________________________________
> Gnutls-devel mailing list
> Gnutls-devel at gnu.org
> http://lists.gnu.org/mailman/listinfo/gnutls-devel
>
>





More information about the Gnutls-devel mailing list