Bug #6173
closedGCC12: error: array subscript 1 is outside array bounds
0%
Description
See: https://aur.archlinux.org/packages/tvheadend-git
In file included from src/tcp.c:32:
In function 'ip_check_is_any_v6',
inlined from 'ip_check_is_any' at src/tcp.h:109:46,
inlined from 'ip_check_is_local_address' at src/tcp.c:89:17:
src/tcp.h:104:57: error: array subscript 1 is outside array bounds of 'const struct sockaddr_storage0' [-Werror=array-bounds]
104 | { return ((uint64_t *)IP_AS_V6(address, addr).s6_addr)[0] == ((uint64_t *)(&in6addr_any.s6_addr))[0] &&
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
src/tcp.h: In function 'ip_check_is_local_address':
src/tcp.h:107:19: note: at offset 8 into object 'address' of size 8
107 | static inline int ip_check_is_any(const struct sockaddr_storage *address)
| ^~~~~~~~~~~~~
In function 'ip_check_is_any_v6',
inlined from 'ip_check_is_any' at src/tcp.h:109:46,
inlined from 'ip_check_is_local_address' at src/tcp.c:89:17:
src/tcp.h:105:57: error: array subscript 2 is outside array bounds of 'const struct sockaddr_storage0' [-Werror=array-bounds]
105 | ((uint64_t *)IP_AS_V6(address, addr).s6_addr)[1] == ((uint64_t *)(&in6addr_any.s6_addr))[1]; }
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
src/tcp.h: In function 'ip_check_is_local_address':
src/tcp.h:107:19: note: at offset 16 into object 'address' of size 8
107 | static inline int ip_check_is_any(const struct sockaddr_storage *address)
| ^~~~~~~~~~~~~
In function 'ip_check_equal_v6',
inlined from 'ip_check_equal' at src/tcp.h:78:42,
inlined from 'ip_check_is_local_address' at src/tcp.c:96:26:
src/tcp.h:71:53: error: array subscript 1 is outside array bounds of 'const struct sockaddr_storage0' [-Werror=array-bounds]
71 | { return ((uint64_t *)IP_AS_V6(a, addr).s6_addr)[0] == ((uint64_t *)IP_AS_V6(b, addr).s6_addr)[0] &&
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
src/tcp.h: In function 'ip_check_is_local_address':
src/tcp.h:74:19: note: at offset 8 into object 'a' of size 8
74 | static inline int ip_check_equal
| ^~~~~~~~~~~~
In function 'ip_check_equal_v6',
inlined from 'ip_check_equal' at src/tcp.h:78:42,
inlined from 'ip_check_is_local_address' at src/tcp.c:96:26:
src/tcp.h:71:99: error: array subscript 1 is outside array bounds of 'const struct sockaddr_storage0' [-Werror=array-bounds]
71 | { return ((uint64_t *)IP_AS_V6(a, addr).s6_addr)[0] == ((uint64_t *)IP_AS_V6(b, addr).s6_addr)[0] &&
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
src/tcp.h: In function 'ip_check_is_local_address':
src/tcp.h:74:19: note: at offset 8 into object 'b' of size 8
74 | static inline int ip_check_equal
| ^~~~~~~~~~~~
In function 'ip_check_equal_v6',
inlined from 'ip_check_equal' at src/tcp.h:78:42,
inlined from 'ip_check_is_local_address' at src/tcp.c:96:26:
src/tcp.h:72:53: error: array subscript 2 is outside array bounds of 'const struct sockaddr_storage0' [-Werror=array-bounds]
72 | ((uint64_t *)IP_AS_V6(a, addr).s6_addr)[1] == ((uint64_t *)IP_AS_V6(b, addr).s6_addr)[1]; }
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
src/tcp.h: In function 'ip_check_is_local_address':
src/tcp.h:74:19: note: at offset 16 into object 'a' of size 8
74 | static inline int ip_check_equal
| ^~~~~~~~~~~~
In function 'ip_check_equal_v6',
inlined from 'ip_check_equal' at src/tcp.h:78:42,
inlined from 'ip_check_is_local_address' at src/tcp.c:96:26:
src/tcp.h:72:99: error: array subscript 2 is outside array bounds of 'const struct sockaddr_storage0' [-Werror=array-bounds]
72 | ((uint64_t *)IP_AS_V6(a, addr).s6_addr)[1] == ((uint64_t *)IP_AS_V6(b, addr).s6_addr)[1]; }
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
src/tcp.h: In function 'ip_check_is_local_address':
src/tcp.h:74:19: note: at offset 16 into object 'b' of size 8
74 | static inline int ip_check_equal