php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #5905 segfaults in zlib.
Submitted: 2000-08-01 18:34 UTC Modified: 2000-08-02 17:21 UTC
From: dairiki at dairiki dot org Assigned:
Status: Closed Package: Reproducible Crash
PHP Version: 4.0.1pl2 OS: linux & others
Private report: No CVE-ID: None
 [2000-08-01 18:34 UTC] dairiki at dairiki dot org
(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;

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-08-02 17:21 UTC] stas@php.net
Fixed in CVS.
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Sat Oct 10 20:00:02 2026 UTC