mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-14 16:04:49 +00:00
lib: Ensure pointer exists before using in mlag
Ensure that the s pointer is valid and usable before grabbing data off of it. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit is contained in:
parent
7791cff31f
commit
d1ba1814bc
@ -85,9 +85,12 @@ int mlag_lib_decode_mlag_hdr(struct stream *s, struct mlag_msg *msg,
|
|||||||
size_t *length)
|
size_t *length)
|
||||||
{
|
{
|
||||||
#define LIB_MLAG_HDR_LENGTH 8
|
#define LIB_MLAG_HDR_LENGTH 8
|
||||||
|
if (s == NULL || msg == NULL)
|
||||||
|
return -1;
|
||||||
|
|
||||||
*length = stream_get_endp(s);
|
*length = stream_get_endp(s);
|
||||||
|
|
||||||
if (s == NULL || msg == NULL || *length < LIB_MLAG_HDR_LENGTH)
|
if (*length < LIB_MLAG_HDR_LENGTH)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
*length -= LIB_MLAG_HDR_LENGTH;
|
*length -= LIB_MLAG_HDR_LENGTH;
|
||||||
|
Loading…
Reference in New Issue
Block a user