From: Donatas Abraitis Date: Wed, 2 Feb 2022 11:30:52 +0000 (+0200) Subject: bgpd: Pass struct pfx_record to sizeof X-Git-Tag: pim6-testing-20220430~366^2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=3b128228e1c375ed0053011912e9943e22c44242;p=matthieu%2Ffrr.git bgpd: Pass struct pfx_record to sizeof Passing argument "&rec" of type "struct pfx_record *" and argument "1UL" to function "read" is suspicious because "sizeof (struct pfx_record) /*40*/" is expected. Signed-off-by: Donatas Abraitis --- diff --git a/bgpd/bgp_rpki.c b/bgpd/bgp_rpki.c index e5027359e7..b320e4e719 100644 --- a/bgpd/bgp_rpki.c +++ b/bgpd/bgp_rpki.c @@ -369,7 +369,7 @@ static int bgpd_sync_callback(struct thread *thread) thread_add_read(bm->master, bgpd_sync_callback, NULL, socket, &t_rpki); if (atomic_load_explicit(&rtr_update_overflow, memory_order_seq_cst)) { - while (read(socket, &rec, sizeof(rec) != -1)) + while (read(socket, &rec, sizeof(struct pfx_record) != -1)) ; atomic_store_explicit(&rtr_update_overflow, 0, @@ -378,8 +378,8 @@ static int bgpd_sync_callback(struct thread *thread) return 0; } - retval = read(socket, &rec, sizeof(rec)); - if (retval != sizeof(rec)) { + retval = read(socket, &rec, sizeof(struct pfx_record)); + if (retval != sizeof(struct pfx_record)) { RPKI_DEBUG("Could not read from socket"); return retval; }