Allow user specify file in mg_http_upload

This commit is contained in:
Sergey Lyubka committed 2024-02-04 08:56:32 +00:00
1 parent fa5aa308bc
commit e0668bc1c0
9 files changed
+80 -62

No files matched your search

+2 -1
View File
@@ -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 ..
}
}