mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2026-01-13 06:57:10 +03:00
Cleanup path nomalization routine and add some further regression tests (MODSEC-123).
This commit is contained in:
@@ -1172,10 +1172,8 @@ int normalise_path_inplace(unsigned char *input, int input_len, int win, int *ch
|
|||||||
|
|
||||||
*changed = 0;
|
*changed = 0;
|
||||||
|
|
||||||
/* Need more than one character to normalize */
|
/* Need at least one byte to normalize */
|
||||||
if (input_len < 1) {
|
if (input_len <= 0) return 0;
|
||||||
return ldst;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* ENH: Deal with UNC and drive letters?
|
* ENH: Deal with UNC and drive letters?
|
||||||
|
|||||||
@@ -24,6 +24,13 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
### Basic
|
### Basic
|
||||||
|
{
|
||||||
|
type => "tfn",
|
||||||
|
name => "normalisePath",
|
||||||
|
input => "x",
|
||||||
|
output => "x",
|
||||||
|
ret => 0,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
type => "tfn",
|
type => "tfn",
|
||||||
name => "normalisePath",
|
name => "normalisePath",
|
||||||
|
|||||||
@@ -24,6 +24,13 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
### Basics
|
### Basics
|
||||||
|
{
|
||||||
|
type => "tfn",
|
||||||
|
name => "normalisePathWin",
|
||||||
|
input => "x",
|
||||||
|
output => "x",
|
||||||
|
ret => 0,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
type => "tfn",
|
type => "tfn",
|
||||||
name => "normalisePathWin",
|
name => "normalisePathWin",
|
||||||
|
|||||||
Reference in New Issue
Block a user