summaryrefslogtreecommitdiff
path: root/suhosin.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 /suhosin.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 'suhosin.c')
-rw-r--r--suhosin.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/suhosin.c b/suhosin.c
index e243bb2..cf2aae4 100644
--- a/suhosin.c
+++ b/suhosin.c
@@ -961,6 +961,34 @@ PHP_INI_END()
961/* }}} */ 961/* }}} */
962 962
963 963
964/* {{{ suhosin_getenv
965 */
966char *suhosin_getenv(char *name, size_t name_len TSRMLS_DC)
967{
968 if (sapi_module.getenv) {
969 char *value, *tmp = sapi_module.getenv(name, name_len TSRMLS_CC);
970 if (tmp) {
971 value = estrdup(tmp);
972 } else {
973 return NULL;
974 }
975 return value;
976 } else {
977 /* fallback to the system's getenv() function */
978 char *tmp;
979
980 name = estrndup(name, name_len);
981 tmp = getenv(name);
982 efree(name);
983 if (tmp) {
984 return(estrdup(tmp));
985 }
986 }
987 return NULL;
988}
989/* }}} */
990
991
964/* {{{ suhosin_bailout 992/* {{{ suhosin_bailout
965 */ 993 */
966void suhosin_bailout(TSRMLS_D) 994void suhosin_bailout(TSRMLS_D)