# HG changeset patch
# User Olaf Wintermann <olaf.wintermann@gmail.com>
# Date 1651396051 -7200
# Node ID f26bd6e17594325108c4ee6ad188acf323568f9d
# Parent  9bf375c4b5bd5b3503bb82cf5538d216a40ad0c5
fix uninitialized memory access in directory check

diff -r 9bf375c4b5bd -r f26bd6e17594 src/server/webdav/webdav.c
--- 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;