(0001740)
vda
11-10-06 15:22
|
Current svn is not exhibiting it. I think this code is guarding agains /../ attack:
/* algorithm stolen from libbb bb_simplify_path(),
but don't strdup and reducing trailing slash and protect out root */
purl = test = url;
do {
if (*purl == '/') {
if (*test == '/') { /* skip duplicate (or initial) slash */
continue;
} else if (*test == '.') {
if (test[1] == '/' || test[1] == 0) { /* skip extra '.' */
continue;
} else if ((test[1] == '.') && (test[2] == '/' || test[2] == 0)) {
++test;
if (purl == url) {
/* protect out root */
goto BAD_REQUEST;
}
while (*--purl != '/') /* omit previous dir */;
continue;
}
}
}
*++purl = *test;
} while (*++test); |