Skip to content

Commit ef4647a

Browse files
committed
Fix GH-17400: bindtextdomain segfault with UTF-16 domain value.
The provided domain could be a non ascii value even if not supposed to, in the error reported case was of 4 code points long but domain is "empty" leading to a NULL return. It worked up to 8.3 "by accident" before the zend_string conversion and check prior for emptiness.
1 parent 7149362 commit ef4647a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

ext/gettext/gettext.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,9 @@ PHP_FUNCTION(bindtextdomain)
212212
}
213213

214214
retval = bindtextdomain(ZSTR_VAL(domain), dir_name);
215+
if (retval == NULL) {
216+
RETURN_FALSE;
217+
}
215218

216219
RETURN_STRING(retval);
217220
}

0 commit comments

Comments
 (0)