[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Minios-devel] [UNIKRAFT PATCH v2] lib/vfscore: stat() - Return EINVAL if pathname is NULL


  • To: minios-devel@xxxxxxxxxxxxx
  • From: Costin Lupu <costin.lupu@xxxxxxxxx>
  • Date: Thu, 22 Aug 2019 13:15:30 +0300
  • Cc: Costin Lupu <costin.lup@xxxxxxxxx>, sharan.santhanam@xxxxxxxxx
  • Delivery-date: Thu, 22 Aug 2019 10:15:37 +0000
  • Ironport-phdr: 9a23:RPjYOxMIn7fjOtIsSwQl6mtUPXoX/o7sNwtQ0KIMzox0Ivv9rarrMEGX3/hxlliBBdydt6sezbOK7uu6BSQp2tWoiDg6aptCVhsI2409vjcLJ4q7M3D9N+PgdCcgHc5PBxdP9nC/NlVJSo6lPwWB6nK94iQPFRrhKAF7Ovr6GpLIj8Swyuu+54Dfbx9HiTagf79+Ngi6oArRu8UZn4dvJbs6xwfUrHdPZ+lY335jK0iJnxb76Mew/Zpj/DpVtvk86cNOUrj0crohQ7BAAzsoL2465MvwtRneVgSP/WcTUn8XkhVTHQfI6gzxU4rrvSv7sup93zSaPdHzQLspVzmu87tnRRn1gyoBKjU38nzYitZogaxbvhyvuhJxzY3TboyOKPZyYrnQcc8ASGZdQspcUTFKDIOmb4sICuoMJfhVr47mp1sSrBu+AxSnCuXyyj9Qm3/9wKo33PgmEQHdwAwgHtQOvG7QrNXoLKcSTPu4w7XTzTnZd/NWxCzy5JLSchAmuPyBW697f8nJyUQ3Cg/IgUicpZbmMj6VzOgBrXaX4uh6We+hk2Irtg58riW1ysovioTFnJwZx17K+Clj3Yo4KsO0RUhmatC+CpRQrTuVN45uT8MnRGFnpTg1x6UduZ6+YCgK0JMnxwPDa/Cfc4iH/BbjVOGJLDdmgXJqYrO/hxKo/Ue80e3wTNG00EtRoSZfiNnMsWgB1x3V6seZVvtw5lqt1DmS2wzJ6exJIVo4mbTFJ5Mj2LI9mIIfsUHZES/3nEX2grWWdkIh+uWw9+vnZa7mpoOdN49ykA3+NrkumtSiAekjLgcORHKX+fyh1LL450H5WrJKguUskqbFqJDaOdgbpqmhDgBJ1YYj8Aq/Dzag0NgCmXkHMUpFdQmIj4jsIV7OIfT4Ae2jjFSrlTdh3+rGMaH5ApXRMnjDl6/sfbN8605ayQozystf64tJBb4fPvL8REvxucfcDh84KAy03/3nBM9y14wAX2KDGKiZMLndsVWQ/OIgP/GMZJMJuDb6M/Ul/P7ugmUjmVAHe6mlx4AXZ2q+HvR6I0WWe3zsjc0EEWoRuAoxUvDliFmYXjFIfXq9Qb88tXkHD9ejDIHCQZvojLGf0SOTGpxNensAGl2KV3DyeNaqQfAJPQmVOdNglHQgSKC8A9sq0gqytQm8z6d/M8Lf4WsAqJilzt8jtL6brg076TEhV5fV6GqKVWwhxm4=
  • Ironport-sdr: odurUqUyOTA2HPkDWJQA7qjBvwH9+kJvafnC7CKSbd7frEhMY1ea/uzavDcovhgRHKivORJKro 62xo9myq7x+w==
  • List-id: Mini-os development list <minios-devel.lists.xenproject.org>

From: Costin Lupu <costin.lup@xxxxxxxxx>

Signed-off-by: Costin Lupu <costin.lupu@xxxxxxxxx>
---
 lib/vfscore/main.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/vfscore/main.c b/lib/vfscore/main.c
index fff233f3..be055b78 100644
--- a/lib/vfscore/main.c
+++ b/lib/vfscore/main.c
@@ -1141,6 +1141,10 @@ LFS64(__xstat);
 
 int stat(const char *pathname, struct stat *st)
 {
+       if (!pathname) {
+               errno = EINVAL;
+               return -1;
+       }
        return __xstat(1, pathname, st);
 }
 
-- 
2.20.1


_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.