#18751 [NEW]: calling 'bind_textdomain_codeset' may crash php4/httpd
| From: | kilbi at rad dot rwth-aachen dot de | Date: | Tue, 06 Aug 2002 10:24:25 +0000 |
| Subject: | #18751 [NEW]: calling 'bind_textdomain_codeset' may crash php4/httpd | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-16064@lists.php.net to get a copy of this message | ||
From: kilbi@rad.rwth-aachen.de
Operating system: NetBSD 1.6*
PHP version: 4.2.2
PHP Bug Type: Reproducible crash
Bug description: calling 'bind_textdomain_codeset' may crash php4/httpd
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);
+ }
}
}
/* }}} */
--
Edit bug report at http://bugs.php.net/?id=18751&edit=1
--
Fixed in CVS: http://bugs.php.net/fix.php?id=18751&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=18751&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=18751&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=18751&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=18751&r=support
Expected behavior: http://bugs.php.net/fix.php?id=18751&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=18751&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=18751&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=18751&r=globals