diff options
| author | Donatas Abraitis <donatas.abraitis@gmail.com> | 2022-02-02 13:30:52 +0200 | 
|---|---|---|
| committer | Donatas Abraitis <donatas@opensourcerouting.org> | 2022-03-05 12:06:08 +0200 | 
| commit | 3288ffdd2f6eed644e9f0966cf8cfa61e9e417e1 (patch) | |
| tree | 6b9d8b4eff1d8d35c92a77c73f9edf69b8ca3a67 | |
| parent | a267f52c3aeecd51ec2b2db5c03115110a1d2516 (diff) | |
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 <donatas.abraitis@gmail.com>
| -rw-r--r-- | bgpd/bgp_rpki.c | 6 | 
1 files changed, 3 insertions, 3 deletions
diff --git a/bgpd/bgp_rpki.c b/bgpd/bgp_rpki.c index f1ee1c9ad7..bd5a5b1ffa 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;  	}  | 
