mirror of
https://github.com/cesanta/mongoose.git
synced 2026-10-19 11:09:42 +00:00
Fixed bug in verify_document_root()
This commit is contained in:
1 parent
3583e83a3f
commit
27ccf416c1
1 file changed
+3
-2
@@ -131,12 +131,13 @@ static void verify_document_root(const char *root) {
|
||||
|
||||
path = root;
|
||||
if ((p = strchr(root, ',')) != NULL && (size_t) (p - root) < sizeof(buf)) {
|
||||
strncpy(buf, root, p - root);
|
||||
memcpy(buf, root, p - root);
|
||||
buf[p - root] = '\0';
|
||||
path = buf;
|
||||
}
|
||||
|
||||
if (stat(path, &st) != 0 || !S_ISDIR(st.st_mode)) {
|
||||
die("Invalid root directory: \"%s\"", root);
|
||||
die("Invalid root directory: [%s]: %s", root, strerror(errno));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user