diff options
Diffstat (limited to 'networking/httpd.c')
-rw-r--r-- | networking/httpd.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/networking/httpd.c b/networking/httpd.c index 9cf080401..7a9065fcc 100644 --- a/networking/httpd.c +++ b/networking/httpd.c | |||
@@ -697,7 +697,7 @@ static void parse_conf(const char *path, int flag) | |||
697 | goto config_error; | 697 | goto config_error; |
698 | } | 698 | } |
699 | *host_port++ = '\0'; | 699 | *host_port++ = '\0'; |
700 | if (strncmp(host_port, "http://", 7) == 0) | 700 | if (is_prefixed_with(host_port, "http://")) |
701 | host_port += 7; | 701 | host_port += 7; |
702 | if (*host_port == '\0') { | 702 | if (*host_port == '\0') { |
703 | goto config_error; | 703 | goto config_error; |
@@ -1894,7 +1894,7 @@ static Htaccess_Proxy *find_proxy_entry(const char *url) | |||
1894 | { | 1894 | { |
1895 | Htaccess_Proxy *p; | 1895 | Htaccess_Proxy *p; |
1896 | for (p = proxy; p; p = p->next) { | 1896 | for (p = proxy; p; p = p->next) { |
1897 | if (strncmp(url, p->url_from, strlen(p->url_from)) == 0) | 1897 | if (is_prefixed_with(url, p->url_from)) |
1898 | return p; | 1898 | return p; |
1899 | } | 1899 | } |
1900 | return NULL; | 1900 | return NULL; |
@@ -2183,7 +2183,7 @@ static void handle_incoming_and_exit(const len_and_sockaddr *fromAddr) | |||
2183 | if (STRNCASECMP(iobuf, "Range:") == 0) { | 2183 | if (STRNCASECMP(iobuf, "Range:") == 0) { |
2184 | /* We know only bytes=NNN-[MMM] */ | 2184 | /* We know only bytes=NNN-[MMM] */ |
2185 | char *s = skip_whitespace(iobuf + sizeof("Range:")-1); | 2185 | char *s = skip_whitespace(iobuf + sizeof("Range:")-1); |
2186 | if (strncmp(s, "bytes=", 6) == 0) { | 2186 | if (is_prefixed_with(s, "bytes=") == 0) { |
2187 | s += sizeof("bytes=")-1; | 2187 | s += sizeof("bytes=")-1; |
2188 | range_start = BB_STRTOOFF(s, &s, 10); | 2188 | range_start = BB_STRTOOFF(s, &s, 10); |
2189 | if (s[0] != '-' || range_start < 0) { | 2189 | if (s[0] != '-' || range_start < 0) { |
@@ -2269,7 +2269,7 @@ static void handle_incoming_and_exit(const len_and_sockaddr *fromAddr) | |||
2269 | tptr = urlcopy + 1; /* skip first '/' */ | 2269 | tptr = urlcopy + 1; /* skip first '/' */ |
2270 | 2270 | ||
2271 | #if ENABLE_FEATURE_HTTPD_CGI | 2271 | #if ENABLE_FEATURE_HTTPD_CGI |
2272 | if (strncmp(tptr, "cgi-bin/", 8) == 0) { | 2272 | if (is_prefixed_with(tptr, "cgi-bin/")) { |
2273 | if (tptr[8] == '\0') { | 2273 | if (tptr[8] == '\0') { |
2274 | /* protect listing "cgi-bin/" */ | 2274 | /* protect listing "cgi-bin/" */ |
2275 | send_headers_and_exit(HTTP_FORBIDDEN); | 2275 | send_headers_and_exit(HTTP_FORBIDDEN); |