Commit 894f215
authored
ext/gettext: throw on libintl NULL return in textdomain/bindtextdomain (#21882)
Both functions can return NULL on libintl-internal allocation failure,
which RETURN_STRING then fed to strlen(NULL) and crashed. Throw an
Error in that case instead, leaving the existing string return type
intact (no static-analysis fallout from a widened signature).
The dir==NULL query path of bindtextdomain keeps its RETURN_FALSE
because musl returns NULL there to signal an unbound domain, which is
not an error condition.1 parent 64760a1 commit 894f215
1 file changed
Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
101 | 106 | | |
102 | 107 | | |
103 | 108 | | |
| |||
211 | 216 | | |
212 | 217 | | |
213 | 218 | | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
214 | 224 | | |
215 | 225 | | |
216 | 226 | | |
| |||
0 commit comments