s6

Mirror/fork of https://skarnet.org/software/s6/
git clone https://ccx.te2000.cz/git/s6
Log | Files | Refs | README | LICENSE

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:
Msrc/libs6/s6-ftrigrd.c | 8+++++++-
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) ;