summaryrefslogtreecommitdiffstats
path: root/qpb
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@nvidia.com>2022-08-02 21:34:43 +0200
committerDonald Sharp <sharpd@nvidia.com>2022-08-02 21:34:43 +0200
commit529766f153963389eaee8de660d9fdfe1c88de19 (patch)
tree5e39b374029fc73800435540994797a49f03cd61 /qpb
parentMerge pull request #11721 from donaldsharp/build_checks (diff)
downloadfrr-529766f153963389eaee8de660d9fdfe1c88de19.tar.xz
frr-529766f153963389eaee8de660d9fdfe1c88de19.zip
qpb: Tell coverity the actual size we are copying
`struct prefix` is a superset of `struct prefix_ipv4` and `struct prefix_ipv6`. Let's let coverity figure it out Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'qpb')
-rw-r--r--qpb/qpb.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/qpb/qpb.h b/qpb/qpb.h
index 9aeb7d01d..45690fb4a 100644
--- a/qpb/qpb.h
+++ b/qpb/qpb.h
@@ -121,11 +121,13 @@ static inline int qpb__l3_prefix__get(const Qpb__L3Prefix *pb_prefix,
switch (family) {
case AF_INET:
- memset(prefix, 0, sizeof(struct prefix_ipv4));
+ memset((struct prefix_ipv4 *)prefix, 0,
+ sizeof(struct prefix_ipv4));
break;
case AF_INET6:
- memset(prefix, 0, sizeof(struct prefix_ipv6));
+ memset((struct prefix_ipv6 *)prefix, 0,
+ sizeof(struct prefix_ipv6));
break;
default: