PHP 4.0 Bug #5905: segfaults in zlib.
| From: | dairiki at dairiki dot org | Date: | Tue, 01 Aug 2000 16:34:47 +0000 |
| Subject: | PHP 4.0 Bug #5905: segfaults in zlib. | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-27271@lists.php.net to get a copy of this message | ||
From: dairiki@dairiki.org
Operating system: linux & others
PHP version: 4.0.1pl2
PHP Bug Type: Reproduceable crash
Bug description: segfaults in zlib.
(I believe ticket #5874 refers to this same problem.)
It's a null pointer dereference problem. Here's a patch. I think it's pretty
self-explanatory.
diff -ru php-4.0.1pl2-orig/ext/zlib/zlib.c php-4.0.1pl2/ext/zlib/zlib.c
--- php-4.0.1pl2-orig/ext/zlib/zlib.c Mon Jun 26 11:19:35 2000
+++ php-4.0.1pl2/ext/zlib/zlib.c Tue Aug 1 09:25:31 2000
@@ -153,8 +153,9 @@
static gzFile php_gzopen_wrapper(char *path, char *mode, int options)
{
FILE *f;
-
- f = php_fopen_wrapper(path, mode, options, NULL, NULL, NULL);
+ int issock, socketd;
+
+ f = php_fopen_wrapper(path, mode, options, &issock, &socketd, NULL);
if (!f) {
return NULL;