summaryrefslogtreecommitdiff
path: root/ext/zlib
diff options
context:
space:
mode:
authorZeev Suraski <zeev@php.net>2000-02-08 21:29:18 +0000
committerZeev Suraski <zeev@php.net>2000-02-08 21:29:18 +0000
commit489b705d4b15ac0774cd30bf011c32abcfc1af23 (patch)
tree0d0e234871be1bd569601eb60e164a557b50f1c9 /ext/zlib
parentca5622c71179156d27442fd760b8164261bba6c2 (diff)
downloadphp-git-489b705d4b15ac0774cd30bf011c32abcfc1af23.tar.gz
@- Fixed memory corruption in fgetss(), strip_tags() and gzgetss() (Zeev)
Diffstat (limited to 'ext/zlib')
-rw-r--r--ext/zlib/zlib.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c
index 7033b6d067..6886aff995 100644
--- a/ext/zlib/zlib.c
+++ b/ext/zlib/zlib.c
@@ -484,6 +484,8 @@ PHP_FUNCTION(gzgetss)
gzFile *zp;
int len;
char *buf;
+ char *allowed_tags=NULL;
+ int allowed_tags_len=0;
ZLIBLS_FETCH();
switch(ARG_COUNT(ht)) {
@@ -497,6 +499,8 @@ PHP_FUNCTION(gzgetss)
RETURN_FALSE;
}
convert_to_string_ex(allow);
+ allowed_tags = (*allow)->value.str.val;
+ allowed_tags_len = (*allow)->value.str.len;
break;
default:
WRONG_PARAM_COUNT;
@@ -519,7 +523,7 @@ PHP_FUNCTION(gzgetss)
}
/* strlen() can be used here since we are doing it on the return of an fgets() anyway */
- php_strip_tags(buf, strlen(buf), ZLIBG(gzgetss_state), allow?(*allow)->value.str.val:NULL);
+ php_strip_tags(buf, strlen(buf), ZLIBG(gzgetss_state), allowed_tags, allowed_tags_len);
RETURN_STRING(buf, 0);
}