diff --git a/apache2/msc_util.c b/apache2/msc_util.c index 51b3f59d..11c10371 100644 --- a/apache2/msc_util.c +++ b/apache2/msc_util.c @@ -1172,10 +1172,8 @@ int normalise_path_inplace(unsigned char *input, int input_len, int win, int *ch *changed = 0; - /* Need more than one character to normalize */ - if (input_len < 1) { - return ldst; - } + /* Need at least one byte to normalize */ + if (input_len <= 0) return 0; /* * ENH: Deal with UNC and drive letters? diff --git a/apache2/t/tfn/normalisePath.t b/apache2/t/tfn/normalisePath.t index 97386a4d..987aaaa1 100644 --- a/apache2/t/tfn/normalisePath.t +++ b/apache2/t/tfn/normalisePath.t @@ -24,6 +24,13 @@ }, ### Basic +{ + type => "tfn", + name => "normalisePath", + input => "x", + output => "x", + ret => 0, +}, { type => "tfn", name => "normalisePath", diff --git a/apache2/t/tfn/normalisePathWin.t b/apache2/t/tfn/normalisePathWin.t index eff8b1a7..dc0f0c3e 100644 --- a/apache2/t/tfn/normalisePathWin.t +++ b/apache2/t/tfn/normalisePathWin.t @@ -24,6 +24,13 @@ }, ### Basics +{ + type => "tfn", + name => "normalisePathWin", + input => "x", + output => "x", + ret => 0, +}, { type => "tfn", name => "normalisePathWin",