- Notifications
You must be signed in to change notification settings - Fork5
Commit5a421a4
committed
Fix inadequately-sized output buffer in contrib/unaccent.
The output buffer size in unaccent_lexize() was calculated as input stringlength times pg_database_encoding_max_length(), which effectively assumesthat replacement strings aren't more than one character. While that wasall that we previously documented it to support, the code actually hasalways allowed replacement strings of arbitrary length; so if you triedto make use of longer strings, you were at risk of buffer overrun. To fix,use an expansible StringInfo buffer instead of trying to determine themaximum space needed a-priori.This would be a security issue if unaccent rules files could be installedby unprivileged users; but fortunately they can't, so in the back branchesthe problem can be labeled as improper configuration by a superuser.Nonetheless, a memory stomp isn't a nice way of reacting to improperconfiguration, so let's back-patch the fix.1 parent9f03ca9 commit5a421a4
1 file changed
+24
-21
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
309 | 310 | | |
310 | 311 | | |
311 | 312 | | |
312 | | - | |
313 | | - | |
314 | | - | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
315 | 319 | | |
316 | 320 | | |
317 | 321 | | |
| |||
322 | 326 | | |
323 | 327 | | |
324 | 328 | | |
325 | | - | |
| 329 | + | |
326 | 330 | | |
327 | | - | |
328 | | - | |
329 | | - | |
330 | | - | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
331 | 334 | | |
332 | | - | |
333 | | - | |
334 | | - | |
335 | | - | |
| 335 | + | |
336 | 336 | | |
337 | | - | |
338 | | - | |
| 337 | + | |
339 | 338 | | |
340 | 339 | | |
341 | 340 | | |
342 | 341 | | |
343 | | - | |
344 | | - | |
345 | | - | |
346 | | - | |
347 | | - | |
| 342 | + | |
| 343 | + | |
348 | 344 | | |
349 | 345 | | |
350 | 346 | | |
351 | 347 | | |
352 | 348 | | |
353 | 349 | | |
354 | | - | |
355 | | - | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
356 | 359 | | |
357 | 360 | | |
358 | 361 | | |
| |||
0 commit comments
Comments
(0)