fix uninitialized memory access in directory check webdav

Sun, 01 May 2022 11:07:31 +0200

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Sun, 01 May 2022 11:07:31 +0200
branch
webdav
changeset 322
f26bd6e17594
parent 321
9bf375c4b5bd
child 323
dc5b0fee49df

fix uninitialized memory access in directory check

src/server/webdav/webdav.c file | annotate | diff | comparison | revisions
--- a/src/server/webdav/webdav.c	Sun May 01 11:03:29 2022 +0200
+++ b/src/server/webdav/webdav.c	Sun May 01 11:07:31 2022 +0200
@@ -667,9 +667,7 @@
             protocol_status(sn, rq, util_errno2status(vfs->vfs_errno), NULL);
             return REQ_ABORTED;
         }
-    }
-    
-    if(S_ISDIR(s.st_mode)) {
+    } else if(S_ISDIR(s.st_mode)) {
         // PUT on collections is not allowed
         protocol_status(sn, rq, PROTOCOL_METHOD_NOT_ALLOWED, NULL);
         return REQ_ABORTED;

mercurial