summaryrefslogtreecommitdiff
path: root/www/php4
diff options
context:
space:
mode:
authorchristos <christos@pkgsrc.org>2003-01-14 21:39:38 +0000
committerchristos <christos@pkgsrc.org>2003-01-14 21:39:38 +0000
commit967e9831cd03c4c7fc09c4e1ca73177a0ef6286a (patch)
treebc32bf29ce9d9d459734213faca12823a2802296 /www/php4
parent8084c059bce668313633fbadd4ce43f707e5989e (diff)
downloadpkgsrc-967e9831cd03c4c7fc09c4e1ca73177a0ef6286a.tar.gz
make sure that gettext does not core dump on bad params.
Diffstat (limited to 'www/php4')
-rw-r--r--www/php4/patches/patch-aj68
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);
+ }
+ }