summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRuben Kerkhof <ruben@rubenkerkhof.com>2020-03-11 10:37:37 +0100
committerRuben Kerkhof <ruben@rubenkerkhof.com>2020-03-11 10:39:35 +0100
commit83e7e1d77441e553f4302ad54820c679ce726f86 (patch)
tree40e654c99a2b4d63bb39409ff88c9f41eb2127e9 /lib
parentMerge pull request #5962 from donaldsharp/whichafisafi (diff)
downloadfrr-83e7e1d77441e553f4302ad54820c679ce726f86.tar.xz
frr-83e7e1d77441e553f4302ad54820c679ce726f86.zip
isisd: fix a bunch of build warnings with GCC 10
GCC 10 thinks we memcpy into a 0-sized array (which we're not). Use a C99 flexible array member instead. Fixes: CC lib/stream.lo lib/stream.c: In function ‘stream_put_in_addr’: lib/stream.c:824:2: warning: writing 4 bytes into a region of size 0 [-Wstringop-overflow=] 824 | memcpy(s->data + s->endp, addr, sizeof(uint32_t)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ isisd/isis_tlvs.c: In function ‘auth_validator_hmac_md5’: isisd/isis_tlvs.c:4279:2: warning: writing 16 bytes into a region of size 0 [-Wstringop-overflow=] 4279 | memcpy(STREAM_DATA(stream) + auth->offset, auth->value, 16); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In function ‘update_auth_hmac_md5’, inlined from ‘update_auth’ at isisd/isis_tlvs.c:3734:4, inlined from ‘isis_pack_tlvs’ at isisd/isis_tlvs.c:3897:2: isisd/isis_tlvs.c:3722:2: warning: writing 16 bytes into a region of size 0 [-Wstringop-overflow=] 3722 | memcpy(STREAM_DATA(s) + auth->offset, digest, 16); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ isisd/isis_tlvs.c:3722:2: warning: writing 16 bytes into a region of size 0 [-Wstringop-overflow=] Signed-off-by: Ruben Kerkhof <ruben@rubenkerkhof.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/stream.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/stream.h b/lib/stream.h
index c0d25e057..36c65afa3 100644
--- a/lib/stream.h
+++ b/lib/stream.h
@@ -110,7 +110,7 @@ struct stream {
size_t getp; /* next get position */
size_t endp; /* last valid data position */
size_t size; /* size of data segment */
- unsigned char data[0]; /* data pointer */
+ unsigned char data[]; /* data pointer */
};
/* First in first out queue structure. */