forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit59e6116
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 parentf14e408 commit59e6116
1 file changed
+27
-24
lines changedLines changed: 27 additions & 24 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
15 | 15 |
| |
16 | 16 |
| |
17 | 17 |
| |
| 18 | + | |
18 | 19 |
| |
19 | 20 |
| |
20 | 21 |
| |
| |||
265 | 266 |
| |
266 | 267 |
| |
267 | 268 |
| |
268 |
| - | |
269 |
| - | |
270 |
| - | |
271 |
| - | |
272 |
| - | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
273 | 275 |
| |
274 |
| - | |
275 | 276 |
| |
276 | 277 |
| |
| 278 | + | |
| 279 | + | |
| 280 | + | |
277 | 281 |
| |
278 | 282 |
| |
279 | 283 |
| |
280 | 284 |
| |
281 | 285 |
| |
282 |
| - | |
| 286 | + | |
283 | 287 |
| |
284 |
| - | |
285 |
| - | |
286 |
| - | |
287 |
| - | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
288 | 291 |
| |
289 |
| - | |
290 |
| - | |
291 |
| - | |
292 |
| - | |
| 292 | + | |
293 | 293 |
| |
294 |
| - | |
295 |
| - | |
296 |
| - | |
297 |
| - | |
298 |
| - | |
299 |
| - | |
300 |
| - | |
| 294 | + | |
301 | 295 |
| |
| 296 | + | |
| 297 | + | |
302 | 298 |
| |
303 | 299 |
| |
304 | 300 |
| |
305 | 301 |
| |
306 |
| - | |
307 |
| - | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
308 | 311 |
| |
309 | 312 |
| |
310 | 313 |
| |
|
0 commit comments
Comments
(0)