summaryrefslogtreecommitdiff
path: root/log.c
diff options
context:
space:
mode:
authorStefan Esser2012-01-14 19:32:14 +0100
committerStefan Esser2012-01-14 19:32:14 +0100
commit3b6c6af3faa6a66e4f5337a769baed32f404b82b (patch)
tree54c4cfe5a6a764fe44e6faac7b3eba21bcb9059f /log.c
parent491c7e914bb972e097565d0fd40141ebb10b6107 (diff)
Use new suhosin_getenv() function in all places
Add protection against mbstring Add detection of incompatible extensions that change POST handlers
Diffstat (limited to '')
-rw-r--r--log.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/log.c b/log.c
index cc297d2..2e3d7a1 100644
--- a/log.c
+++ b/log.c
@@ -118,12 +118,12 @@ PHP_SUHOSIN_API void suhosin_log(int loglevel, char *fmt, ...)
118 } 118 }
119 119
120 if (SUHOSIN_G(log_use_x_forwarded_for)) { 120 if (SUHOSIN_G(log_use_x_forwarded_for)) {
121 ip_address = sapi_getenv("HTTP_X_FORWARDED_FOR", 20 TSRMLS_CC); 121 ip_address = suhosin_getenv("HTTP_X_FORWARDED_FOR", 20 TSRMLS_CC);
122 if (ip_address == NULL) { 122 if (ip_address == NULL) {
123 ip_address = "X-FORWARDED-FOR not set"; 123 ip_address = "X-FORWARDED-FOR not set";
124 } 124 }
125 } else { 125 } else {
126 ip_address = sapi_getenv("REMOTE_ADDR", 11 TSRMLS_CC); 126 ip_address = suhosin_getenv("REMOTE_ADDR", 11 TSRMLS_CC);
127 if (ip_address == NULL) { 127 if (ip_address == NULL) {
128 ip_address = "REMOTE_ADDR not set"; 128 ip_address = "REMOTE_ADDR not set";
129 } 129 }
@@ -154,7 +154,7 @@ PHP_SUHOSIN_API void suhosin_log(int loglevel, char *fmt, ...)
154 } 154 }
155 ap_php_snprintf(buf, sizeof(buf), "%s - %s (attacker '%s', file '%s', line %u)", alertstring, error, ip_address, fname, lineno); 155 ap_php_snprintf(buf, sizeof(buf), "%s - %s (attacker '%s', file '%s', line %u)", alertstring, error, ip_address, fname, lineno);
156 } else { 156 } else {
157 fname = sapi_getenv("SCRIPT_FILENAME", 15 TSRMLS_CC); 157 fname = suhosin_getenv("SCRIPT_FILENAME", 15 TSRMLS_CC);
158 if (fname==NULL) { 158 if (fname==NULL) {
159 fname = "unknown"; 159 fname = "unknown";
160 } 160 }