Don't use ibuf_open(0) as test. 0 lenght ibufs make little sense and
authorclaudio <claudio@openbsd.org>
Tue, 23 May 2023 09:32:37 +0000 (09:32 +0000)
committerclaudio <claudio@openbsd.org>
Tue, 23 May 2023 09:32:37 +0000 (09:32 +0000)
result in a malloc(0) call which is no bueno. Use ibuf_open(1) instead.
OK miod@

regress/lib/libutil/imsg/ibuf_test.c

index a85b31a..2e3702f 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: ibuf_test.c,v 1.1 2022/04/23 08:57:52 tobias Exp $
+/* $OpenBSD: ibuf_test.c,v 1.2 2023/05/23 09:32:37 claudio Exp $
 */
 /*
  * Copyright (c) Tobias Stoeckmann <tobias@openbsd.org>
@@ -29,7 +29,7 @@ int
 test_ibuf_open(void) {
        struct ibuf *buf;
 
-       if ((buf = ibuf_open(0)) == NULL)
+       if ((buf = ibuf_open(1)) == NULL)
                return 1;
 
        ibuf_free(buf);