mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-01 13:10:43 +00:00
Allow user specify file in mg_http_upload
This commit is contained in:
1 parent
fa5aa308bc
commit
e0668bc1c0
9 files changed
+80
-62
No files matched your search
@@ -189,8 +189,9 @@ void mg_unhex(const char *buf, size_t len, unsigned char *to) {
|
||||
|
||||
bool mg_path_is_sane(const char *path) {
|
||||
const char *s = path;
|
||||
if (path[0] == '.' && path[1] == '.') return false; // Starts with ..
|
||||
for (; s[0] != '\0'; s++) {
|
||||
if (s == path || s[0] == '/' || s[0] == '\\') { // Subdir?
|
||||
if (s[0] == '/' || s[0] == '\\') { // Subdir?
|
||||
if (s[1] == '.' && s[2] == '.') return false; // Starts with ..
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user