Skip to content
/ src Public

Commit 8b667af

Browse files
committed
Ensure that the embedded lsa.len is at least sizeof(lsa) bytes long.
OK deraadt@ tb@
1 parent 39325e2 commit 8b667af

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

usr.sbin/ospfd/lsupdate.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $OpenBSD: lsupdate.c,v 1.54 2024/08/21 15:18:00 florian Exp $ */
1+
/* $OpenBSD: lsupdate.c,v 1.55 2026/05/19 08:14:47 claudio Exp $ */
22

33
/*
44
* Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
@@ -269,7 +269,8 @@ recv_ls_update(struct nbr *nbr, char *buf, u_int16_t len)
269269
return;
270270
}
271271
memcpy(&lsa, buf, sizeof(lsa));
272-
if (len < ntohs(lsa.len)) {
272+
if (ntohs(lsa.len) < sizeof(lsa) ||
273+
len < ntohs(lsa.len)) {
273274
log_warnx("recv_ls_update: bad packet size, "
274275
"neighbor ID %s (%s)", inet_ntoa(nbr->id),
275276
nbr->iface->name);

0 commit comments

Comments
 (0)