mirror of
https://github.com/cesanta/mongoose.git
synced 2026-10-26 12:14:56 +00:00
collaterals #3140
We prepend current path to the URI, so a tilde could not be the first char in a path. However, the same would happen for double dots, and since we're already checking for that, it doesn't hurt to be on the safe side for future's sake.
This commit is contained in:
1 parent
662cc27f4f
commit
a801160bc0
3 files changed
+3
-1
No files matched your search
+1
-1
@@ -216,7 +216,7 @@ static bool vcb(uint8_t c) {
|
||||
static size_t clen(const char *s, const char *end) {
|
||||
const unsigned char *u = (unsigned char *) s, c = *u;
|
||||
long n = (long) (end - s);
|
||||
if (c > ' ' && c < '~') return 1; // Usual ascii printed char
|
||||
if (c > ' ' && c <= '~') return 1; // Usual ascii printed char
|
||||
if ((c & 0xe0) == 0xc0 && n > 1 && vcb(u[1])) return 2; // 2-byte UTF8
|
||||
if ((c & 0xf0) == 0xe0 && n > 2 && vcb(u[1]) && vcb(u[2])) return 3;
|
||||
if ((c & 0xf8) == 0xf0 && n > 3 && vcb(u[1]) && vcb(u[2]) && vcb(u[3]))
|
||||
|
||||
Reference in new issue
Block a user