Commit 4ba7eff
committed
jp2uc/up2jc: avoid crash due to invalid pointer
Commit 4356ccd ("towupper/towlower: handle Turkic language special
casing") changed the locale pointer in calls to towctrans_l from a NULL
pointer to LC_GLOBAL_LOCALE, which is defined as -1.
Unfortunately jp2uc_l/up2jc_l just expect a NULL or non-NULL pointer,
so LC_GLOBAL_LOCALE as input is derefenced later on and the call crashes.
To fix this problem, handle LC_GLOBAL_LOCALE just as if a NULL pointer
has been passed to the function. Keep the NULL pointer handling intact
for backward compatibility.
Fixes: 4356ccd ("towupper/towlower: handle Turkic language special casing")
Reported-by: Christophe Lyon <christophe.lyon.oss@gmail.com>
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>1 parent 8f1d2b4 commit 4ba7eff
1 file changed
Lines changed: 5 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
166 | 166 | | |
167 | 167 | | |
168 | 168 | | |
169 | | - | |
| 169 | + | |
| 170 | + | |
170 | 171 | | |
171 | 172 | | |
172 | 173 | | |
| |||
179 | 180 | | |
180 | 181 | | |
181 | 182 | | |
182 | | - | |
| 183 | + | |
183 | 184 | | |
184 | 185 | | |
185 | 186 | | |
186 | 187 | | |
187 | 188 | | |
188 | 189 | | |
189 | | - | |
| 190 | + | |
| 191 | + | |
190 | 192 | | |
191 | 193 | | |
192 | 194 | | |
| |||
0 commit comments