From: Daniel Golle Date: Wed, 4 Aug 2021 15:35:29 +0000 (+0100) Subject: jail: don't ignore return value of write() X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=516bdf26d4f60dc5fb063da8715fed2bad24dbd0;p=project%2Fprocd.git jail: don't ignore return value of write() Check return value of write() call when writing to sysctl. Signed-off-by: Daniel Golle --- diff --git a/jail/jail.c b/jail/jail.c index 2fa3b2a..92ced45 100644 --- a/jail/jail.c +++ b/jail/jail.c @@ -536,7 +536,10 @@ static int apply_sysctl(const char *jail_root) ERROR("sysctl: can't open %s\n", fname); return errno; } - write(f, (*cur)->value, strlen((*cur)->value)); + if (write(f, (*cur)->value, strlen((*cur)->value)) < 0) { + ERROR("sysctl: write to %s\n", fname); + return errno; + } free(fname); close(f);