diff options
author | christos <christos> | 2003-01-14 21:39:38 +0000 |
---|---|---|
committer | christos <christos> | 2003-01-14 21:39:38 +0000 |
commit | 77a342f3d1b6a93fd59f16a32b011f8fc59c65e6 (patch) | |
tree | bc32bf29ce9d9d459734213faca12823a2802296 /www | |
parent | 20aca50170d54cc3cf951068e56edc108a4499fa (diff) | |
download | pkgsrc-77a342f3d1b6a93fd59f16a32b011f8fc59c65e6.tar.gz |
make sure that gettext does not core dump on bad params.
Diffstat (limited to 'www')
-rw-r--r-- | www/php4/patches/patch-aj | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/www/php4/patches/patch-aj b/www/php4/patches/patch-aj new file mode 100644 index 00000000000..b1147480f4b --- /dev/null +++ b/www/php4/patches/patch-aj @@ -0,0 +1,68 @@ +$NetBSD: patch-aj,v 1.3 2003/01/14 21:39:38 christos Exp $ + +--- ext/gettext/gettext.c.orig Sat Dec 15 09:22:59 2001 ++++ ext/gettext/gettext.c Tue Jan 14 16:37:25 2003 +@@ -58,6 +58,11 @@ + }; + /* }}} */ + ++#define CHECK(a) if (a == NULL) { \ ++ fprintf(stderr, "%s, %d: NULL value\n", __FILE__, __LINE__); \ ++ a = ""; \ ++} ++ + zend_module_entry php_gettext_module_entry = { + STANDARD_MODULE_HEADER, + "gettext", +@@ -103,7 +108,7 @@ + } + + retval = textdomain(domain_name); +- ++ CHECK(retval); + RETURN_STRING(retval, 1); + } + /* }}} */ +@@ -122,6 +127,7 @@ + + msgstr = gettext(Z_STRVAL_PP(msgid)); + ++ CHECK(msgstr); + RETURN_STRING(msgstr, 1); + } + /* }}} */ +@@ -141,6 +147,7 @@ + + msgstr = dgettext(Z_STRVAL_PP(domain_name), Z_STRVAL_PP(msgid)); + ++ CHECK(msgstr); + RETURN_STRING(msgstr, 1); + } + /* }}} */ +@@ -161,6 +168,7 @@ + + msgstr = dcgettext(Z_STRVAL_PP(domain_name), Z_STRVAL_PP(msgid), Z_LVAL_PP(category)); + ++ CHECK(msgstr); + RETURN_STRING(msgstr, 1); + } + /* }}} */ +@@ -186,6 +194,7 @@ + + retval = bindtextdomain(Z_STRVAL_PP(domain_name), dir_name); + ++ CHECK(retval); + RETURN_STRING(retval, 1); + } + /* }}} */ +@@ -291,6 +300,10 @@ + + retval = bind_textdomain_codeset(Z_STRVAL_PP(domain), Z_STRVAL_PP(codeset)); + ++ CHECK(retval); ++ fprintf(stderr, "%s, %s: (%s, %s) -> %s\n", ++ __FILE__, __LINE__, ++ Z_STRVAL_PP(domain), Z_STRVAL_PP(codeset), retval); + RETURN_STRING(retval, 1); + } + } |