artulab
projects
/
openbsd
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e12e039
)
Avoid calling ibuf_add() with NULL and zero length.
author
tobhe
<tobhe@openbsd.org>
Mon, 17 May 2021 08:14:37 +0000
(08:14 +0000)
committer
tobhe
<tobhe@openbsd.org>
Mon, 17 May 2021 08:14:37 +0000
(08:14 +0000)
ok patrick@
sbin/iked/imsg_util.c
patch
|
blob
|
history
diff --git
a/sbin/iked/imsg_util.c
b/sbin/iked/imsg_util.c
index
90b7f6e
..
2f0ee32
100644
(file)
--- a/
sbin/iked/imsg_util.c
+++ b/
sbin/iked/imsg_util.c
@@
-1,4
+1,4
@@
-/* $OpenBSD: imsg_util.c,v 1.1
2 2019/11/30 15:44:0
7 tobhe Exp $ */
+/* $OpenBSD: imsg_util.c,v 1.1
3 2021/05/17 08:14:3
7 tobhe Exp $ */
/*
* Copyright (c) 2010-2013 Reyk Floeter <reyk@openbsd.org>
@@
-59,7
+59,10
@@
ibuf_new(const void *data, size_t len)
ibuf_zero(buf);
- if (data == NULL && len) {
+ if (len == 0)
+ return (buf);
+
+ if (data == NULL) {
if (ibuf_advance(buf, len) == NULL) {
ibuf_free(buf);
return (NULL);