php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #960 Apache SIGSEGV hang on getallheaders()
Submitted: 1998-11-30 07:27 UTC Modified: 1998-11-30 11:02 UTC
From: michale at utko dot fee dot vutbr dot cz Assigned:
Status: Closed Package: Reproducible Crash
PHP Version: 3.0.5 OS: unix using libc
Private report: No CVE-ID: None
 [1998-11-30 07:27 UTC] michale at utko dot fee dot vutbr dot cz
	In case of occurence NULL strings in http headers hangs the Apache version of php3 during php3_getallheaders function. 
	This is because add_assoc_string() internal fuction cannot handle NULL pointer strings, the libc strlen(NULL) function called from add_assoc_string has bad NULL argument.
	NULL value in http header is not prohibited value, Apache woks with such headers correctly. NULL header string generates e.g. mod_html module & patch (module for language encoding, mailto:lampa@fee.vutbr.cz).

	Here is a patch to correct the problem:



*** apache.c.old        Mon Oct  5 02:21:36 1998
--- apache.c    Mon Nov 30 11:50:28 1998
***************
*** 217,223 ****
                         !strncasecmp(tenv[i].key, "authorization", 13))) {
                        continue;
                }
!               if (add_assoc_string(return_value, tenv[i].key,tenv[i].val, 1)==FAILURE) {
                        RETURN_FALSE;
                }
      }
--- 217,223 ----
                         !strncasecmp(tenv[i].key, "authorization", 13))) {
                        continue;
                }
!               if (add_assoc_string(return_value, tenv[i].key,(tenv[i].val==NULL) ? "" : tenv[i].val, 1)==FAILURE) {
                        RETURN_FALSE;
                }
      }

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1998-11-30 11:02 UTC] rasmus
Applied - Thanks for catching this one.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 24 09:01:28 2024 UTC