diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2014-12-06 21:12:56 +0000 |
---|---|---|
committer | Laurent Bercot <ska-skaware@skarnet.org> | 2014-12-06 21:12:56 +0000 |
commit | c7be5adf01d8a74fd4faef4d249502e9947e9073 (patch) | |
tree | 9c8572f1881436b128cbe6731db19bab03ddd16b /src/libs6/s6-ftrigrd.c | |
parent | adb57f45278de244686ba5f72d2700fecc302e12 (diff) | |
download | s6-c7be5adf01d8a74fd4faef4d249502e9947e9073.tar.xz |
Fix: correctly init ftrigio buffer in s6-ftrigrd
Diffstat (limited to 'src/libs6/s6-ftrigrd.c')
-rw-r--r-- | src/libs6/s6-ftrigrd.c | 8 |
1 files changed, 7 insertions, 1 deletions
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 <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) ; |