From: Alan Cox Date: Thu, 23 Nov 2017 21:45:08 +0000 (+0000) Subject: filesys: Fix corruption and buffer leak on bad input address X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=0be28c68753980b5de3a30aa7069c7305c30ff41;p=FUZIX.git filesys: Fix corruption and buffer leak on bad input address --- diff --git a/Kernel/filesys.c b/Kernel/filesys.c index 8153c6f8..73691179 100644 --- a/Kernel/filesys.c +++ b/Kernel/filesys.c @@ -30,7 +30,9 @@ inoptr n_open(char *uname, inoptr *parent) if (ugets(uname, tb, 512) == -1) { udata.u_error = EFAULT; - *parent = NULLINODE; + if (parent) + *parent = NULLINODE; + pathfree(tb); return NULLINODE; }