mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-10 16:31:44 +00:00
enhanced path sanitizing
This commit is contained in:
1 parent
4b0e34cdf4
commit
2f1a836bf0
7 files changed
+86
-79
No files matched your search
+25
-25
@@ -256,30 +256,30 @@ static inline int mg_mkdir(const char *path, mode_t mode) {
|
||||
#include <pico/stdlib.h>
|
||||
int mkdir(const char *, mode_t);
|
||||
#endif
|
||||
|
||||
|
||||
#if MG_ARCH == MG_ARCH_RTTHREAD
|
||||
|
||||
#include <rtthread.h>
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/select.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
#include <time.h>
|
||||
|
||||
#ifndef MG_IO_SIZE
|
||||
#define MG_IO_SIZE 1460
|
||||
#endif
|
||||
|
||||
#endif // MG_ARCH == MG_ARCH_RTTHREAD
|
||||
|
||||
|
||||
#if MG_ARCH == MG_ARCH_RTTHREAD
|
||||
|
||||
#include <rtthread.h>
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/select.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
#include <time.h>
|
||||
|
||||
#ifndef MG_IO_SIZE
|
||||
#define MG_IO_SIZE 1460
|
||||
#endif
|
||||
|
||||
#endif // MG_ARCH == MG_ARCH_RTTHREAD
|
||||
|
||||
|
||||
#if MG_ARCH == MG_ARCH_ARMCC || MG_ARCH == MG_ARCH_CMSIS_RTOS1 || \
|
||||
@@ -859,7 +859,7 @@ char *mg_hex(const void *buf, size_t len, char *dst);
|
||||
void mg_unhex(const char *buf, size_t len, unsigned char *to);
|
||||
unsigned long mg_unhexn(const char *s, size_t len);
|
||||
int mg_check_ip_acl(struct mg_str acl, uint32_t remote_ip);
|
||||
char *mg_remove_double_dots(char *s);
|
||||
bool mg_path_is_sane(const char *path);
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user