With 'bytes(__u32)' being 32, a left-shift of 31 may happen which is undefined for the signed 32-bit value 1. Avoid this by declaring 1 as unsigned.
Showing the changes to include/uapi (1 of 1 file). Show all
Unified · Split
| @@ -41,19 +41,19 @@ struct xt_sctp_info { · 40 unmodified lines | ||
| 41 | 41 | #define SCTP_CHUNKMAP_SET(chunkmap, type) \ |
| 42 | 42 | do { \ |
| 43 | 43 | (chunkmap)[type / bytes(__u32)] |= \ |
| 44 | − 1 << (type % bytes(__u32)); \ | |
| 44 | + 1u << (type % bytes(__u32)); \ | |
| 45 | 45 | } while (0) |
| 46 | 46 | |
| 47 | 47 | #define SCTP_CHUNKMAP_CLEAR(chunkmap, type) \ |
| 48 | 48 | do { \ |
| 49 | 49 | (chunkmap)[type / bytes(__u32)] &= \ |
| 50 | − ~(1 << (type % bytes(__u32))); \ | |
| 50 | + ~(1u << (type % bytes(__u32))); \ | |
| 51 | 51 | } while (0) |
| 52 | 52 | |
| 53 | 53 | #define SCTP_CHUNKMAP_IS_SET(chunkmap, type) \ |
| 54 | 54 | ({ \ |
| 55 | 55 | ((chunkmap)[type / bytes (__u32)] & \ |
| 56 | − (1 << (type % bytes (__u32)))) ? 1: 0; \ | |
| 56 | + (1u << (type % bytes (__u32)))) ? 1: 0; \ | |
| 57 | 57 | }) |
| 58 | 58 | |
| 59 | 59 | #define SCTP_CHUNKMAP_RESET(chunkmap) \ |