commit c7be5adf01d8a74fd4faef4d249502e9947e9073
parent adb57f45278de244686ba5f72d2700fecc302e12
Author: Laurent Bercot <ska-skaware@skarnet.org>
Date: Sat, 6 Dec 2014 21:12:56 +0000
Fix: correctly init ftrigio buffer in s6-ftrigrd
Diffstat:
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/libs6/s6-ftrigrd.c b/src/libs6/s6-ftrigrd.c
@@ -23,7 +23,7 @@
#include <s6/ftrigr.h>
#define FTRIGRD_MAXREADS 32
-#define FTRIGRD_BUFSIZE 16
+#define FTRIGRD_BUFSIZE 17
#define dienomem() strerr_diefu1sys(111, "stralloc_catb")
@@ -166,6 +166,12 @@ static int parse_protocol (unixmessage_t const *m, void *context)
answer(errno) ;
break ;
}
+ if (!buffer_init(&buffer_read, f.fd, f.buf, FTRIGRD_BUFSIZE))
+ {
+ ftrigio_deepfree(&f) ;
+ answer(errno) ;
+ break ;
+ }
if (!genalloc_append(ftrigio_t, &a, &f))
{
ftrigio_deepfree(&f) ;