Cleanup path nomalization routine and add some further regression tests (MODSEC-123).

This commit is contained in:
b1v1r
2010-02-05 18:38:56 +00:00
parent 04fe141c73
commit 6748e04996
3 changed files with 16 additions and 4 deletions

View File

@@ -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?

View File

@@ -24,6 +24,13 @@
}, },
### Basic ### Basic
{
type => "tfn",
name => "normalisePath",
input => "x",
output => "x",
ret => 0,
},
{ {
type => "tfn", type => "tfn",
name => "normalisePath", name => "normalisePath",

View File

@@ -24,6 +24,13 @@
}, },
### Basics ### Basics
{
type => "tfn",
name => "normalisePathWin",
input => "x",
output => "x",
ret => 0,
},
{ {
type => "tfn", type => "tfn",
name => "normalisePathWin", name => "normalisePathWin",