Project

General

Profile

Actions

Bug #6173

closed

GCC12: error: array subscript 1 is outside array bounds

Added by Dirk Diggler almost 3 years ago. Updated over 2 years ago.

Status:
Fixed
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
2022-05-27
Due date:
% Done:

0%

Estimated time:
Found in version:
latest snapshot
Affected Versions:

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

Actions

Also available in: Atom PDF