Merge pull request #26062 from cleverca22/libredirect

libredirect: allow null paths
This commit is contained in:
Eelco Dolstra 2017-05-24 18:09:55 +02:00 committed by GitHub
commit dc4e2cd70f

View File

@ -47,6 +47,7 @@ static void init()
static const char * rewrite(const char * path, char * buf) static const char * rewrite(const char * path, char * buf)
{ {
if (path == NULL) return path;
for (int n = 0; n < nrRedirects; ++n) { for (int n = 0; n < nrRedirects; ++n) {
int len = strlen(from[n]); int len = strlen(from[n]);
if (strncmp(path, from[n], len) != 0) continue; if (strncmp(path, from[n], len) != 0) continue;