mirror of
https://gitlab.xiph.org/xiph/icecast-server.git
synced 2024-11-03 04:17:17 -05:00
Fix: remove tailing dots in URI.
This works around the problem that windows ignores tailing dots. This way you could trick Icecast2 to send a XSLT file as plain text. Please test. Closes: #2247
This commit is contained in:
parent
255af9e610
commit
471cbaa60b
@ -379,6 +379,9 @@ char *util_url_unescape (const char *src)
|
|||||||
*/
|
*/
|
||||||
char *util_normalise_uri(const char *uri) {
|
char *util_normalise_uri(const char *uri) {
|
||||||
char *path;
|
char *path;
|
||||||
|
#ifdef _WIN32
|
||||||
|
size_t len;
|
||||||
|
#endif
|
||||||
|
|
||||||
if(uri[0] != '/')
|
if(uri[0] != '/')
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -390,6 +393,12 @@ char *util_normalise_uri(const char *uri) {
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
/* If we are on Windows, strip trailing dots, as Win API strips it anyway */
|
||||||
|
for (len = strlen(path); len > 0 && path[len-1] == '.'; len--)
|
||||||
|
path[len-1] = '\0';
|
||||||
|
#endif
|
||||||
|
|
||||||
/* We now have a full URI-decoded path. Check it for allowability */
|
/* We now have a full URI-decoded path. Check it for allowability */
|
||||||
if(verify_path(path))
|
if(verify_path(path))
|
||||||
return path;
|
return path;
|
||||||
|
Loading…
Reference in New Issue
Block a user