gnutls-devel
[Top][All Lists]
Advanced

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

Re: DECR macro signedness


From: Nikos Mavrogiannopoulos
Subject: Re: DECR macro signedness
Date: Tue, 12 Jan 2010 09:32:57 +0100

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
<address@hidden> 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
> address@hidden
> http://lists.gnu.org/mailman/listinfo/gnutls-devel
>
>




reply via email to

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