Skip to content

Commit c01e607

Browse files
committed
backport 1927034 from trunk
escape ssl vars Reviewed By: rpluem, jorton, covener, ylavic git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1927042 13f79535-47bb-0310-9956-ffa450edef68
1 parent 8efe8ea commit c01e607

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

modules/ssl/ssl_engine_vars.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1208,8 +1208,9 @@ static const char *ssl_var_log_handler_c(request_rec *r, char *a)
12081208
result = "-";
12091209
else if (strEQ(a, "errstr"))
12101210
result = (char *)sslconn->verify_error;
1211-
if (result != NULL && result[0] == NUL)
1212-
result = NULL;
1211+
if (result) {
1212+
result = *result ? ap_escape_logitem(r->pool, result) : NULL;
1213+
}
12131214
return result;
12141215
}
12151216

@@ -1222,8 +1223,9 @@ static const char *ssl_var_log_handler_x(request_rec *r, char *a)
12221223
char *result;
12231224

12241225
result = ssl_var_lookup(r->pool, r->server, r->connection, r, a);
1225-
if (result != NULL && result[0] == NUL)
1226-
result = NULL;
1226+
if (result) {
1227+
result = *result ? ap_escape_logitem(r->pool, result) : NULL;
1228+
}
12271229
return result;
12281230
}
12291231

0 commit comments

Comments
 (0)