[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
DECR macro signedness
From: |
Steve Dispensa |
Subject: |
DECR macro signedness |
Date: |
Tue, 12 Jan 2010 00:12:32 -0600 |
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
decr_patch
Description: decr_patch
- DECR macro signedness,
Steve Dispensa <=