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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: kilbi at rad dot rwth-aachen dot de
New email:
PHP Version: OS:

 

 [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

Pull Requests

History

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