diff options
author | 2005-04-05 12:59:18 +0000 | |
---|---|---|
committer | 2005-04-05 12:59:18 +0000 | |
commit | 56b0f6ff364e2f010b5c13c67db1126c165dd1af (patch) | |
tree | 55b164a0e230e9f276bfb300f5971fcbd2e9674f | |
parent | Return EINVAL in SIOCSIFLLADDR if new lladdr is a multicast address. (diff) | |
download | wireguard-openbsd-56b0f6ff364e2f010b5c13c67db1126c165dd1af.tar.xz wireguard-openbsd-56b0f6ff364e2f010b5c13c67db1126c165dd1af.zip |
Set errno in case buf_realloc() fails because the limit of the buffer is
reached.
-rw-r--r-- | usr.sbin/ospfd/buffer.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.sbin/ospfd/buffer.c b/usr.sbin/ospfd/buffer.c index eea84a5cdf0..8a70cf3ac63 100644 --- a/usr.sbin/ospfd/buffer.c +++ b/usr.sbin/ospfd/buffer.c @@ -1,4 +1,4 @@ -/* $OpenBSD: buffer.c,v 1.4 2005/03/23 11:36:34 henning Exp $ */ +/* $OpenBSD: buffer.c,v 1.5 2005/04/05 12:59:18 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -73,8 +73,10 @@ buf_realloc(struct buf *buf, size_t len) u_char *b; /* on static buffers max is eq size and so the following fails */ - if (buf->wpos + len > buf->max) + if (buf->wpos + len > buf->max) { + errno = ENOMEM; return (-1); + } b = realloc(buf->buf, buf->wpos + len); if (b == NULL) |