diff options
| author | Phil Sutter <phil@nwl.cc> | 2024-05-17 15:20:05 +0200 |
|---|---|---|
| committer | Phil Sutter <phil@nwl.cc> | 2024-06-12 17:14:27 +0200 |
| commit | 0234117d24609070f08ef36a11795c3c8e4c19bf (patch) | |
| tree | 43d2163cc2f938a3dcee247561787fe7f856632f /extensions | |
| parent | 14f313ec68e2e4ff7eeb94b0fd125f7adcab77e3 (diff) | |
extensions: libxt_sctp: Add an extra assert()
The code is sane, but this keeps popping up in static code analyzers.
Signed-off-by: Phil Sutter <phil@nwl.cc>
Diffstat (limited to 'extensions')
| -rw-r--r-- | extensions/libxt_sctp.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/extensions/libxt_sctp.c b/extensions/libxt_sctp.c index 6e2b2745..e8312f0c 100644 --- a/extensions/libxt_sctp.c +++ b/extensions/libxt_sctp.c @@ -7,6 +7,7 @@ * libipt_ecn.c borrowed heavily from libipt_dscp.c * */ +#include <assert.h> #include <stdbool.h> #include <stdio.h> #include <string.h> @@ -354,6 +355,7 @@ print_chunk_flags(uint32_t chunknum, uint8_t chunk_flags, uint8_t chunk_flags_ma for (i = 7; i >= 0; i--) { if (chunk_flags_mask & (1 << i)) { + assert(chunknum < ARRAY_SIZE(sctp_chunk_names)); if (chunk_flags & (1 << i)) { printf("%c", sctp_chunk_names[chunknum].valid_flags[7-i]); } else { |
