Skip to content

Commit

Permalink
[mod_extforward] fix crash on invalid IP (fixes #2766)
Browse files Browse the repository at this point in the history
x-ref:
  "crashes for invalid IP addresses when using mod_extforward"
  https://redmine.lighttpd.net/issues/2766
  • Loading branch information
gstrauss committed Nov 24, 2016
1 parent 6533056 commit bb30f44
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/mod_extforward.c
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,7 @@ URIHANDLER_FUNC(mod_extforward_uri_handler) {
if (real_remote_addr != NULL) { /* parsed */
sock_addr sock;
data_string *forwarded_proto = (data_string *)array_get_element(con->request.headers, "X-Forwarded-Proto");
sock.plain.sa_family = AF_UNSPEC;

if (NULL != forwarded_proto) {
if (buffer_is_equal_caseless_string(forwarded_proto->value, CONST_STR_LEN("https"))) {
Expand Down

0 comments on commit bb30f44

Please sign in to comment.