php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #18751 calling 'bind_textdomain_codeset' may crash php4/httpd
Submitted: 2002-08-06 06:24 UTC Modified: 2002-08-07 07:52 UTC
From: kilbi at rad dot rwth-aachen dot de Assigned:
Status: Closed Package: Reproducible crash
PHP Version: 4.2.2 OS: NetBSD 1.6*
Private report: No CVE-ID: None
 [2002-08-06 06:24 UTC] kilbi at rad dot rwth-aachen dot de
In my case (NetBSD 1.6*) the system function 'bind_textdomain_codeset' is not yet implemented (== returns NULL always), but present. This causes a segmentation fault in every case php4's pendent function is called.

Fix: Something like the following would generally prevent running in this NULL pointer trouble:

--- gettext.c~  Sat Dec 15 15:22:59 2001
+++ gettext.c   Tue Aug  6 11:59:25 2002
@@ -291,7 +291,9 @@
                
                retval = bind_textdomain_codeset(Z_STRVAL_PP(domain), Z_STRVAL_PP(codeset));
 
-               RETURN_STRING(retval, 1);
+               if (retval) {
+                       RETURN_STRING(retval, 1);
+               }
        }       
 }
 /* }}} */

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-08-07 07:52 UTC] yohgaki@php.net
Thanks. Patch applied.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 06:01:29 2024 UTC