From c7be5adf01d8a74fd4faef4d249502e9947e9073 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Sat, 6 Dec 2014 21:12:56 +0000 Subject: Fix: correctly init ftrigio buffer in s6-ftrigrd --- src/libs6/s6-ftrigrd.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/libs6/s6-ftrigrd.c b/src/libs6/s6-ftrigrd.c index b766f36..efa7fe8 100644 --- a/src/libs6/s6-ftrigrd.c +++ b/src/libs6/s6-ftrigrd.c @@ -23,7 +23,7 @@ #include #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) ; -- cgit v1.2.3