forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit49bca9e
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 parent4dc3df9 commit49bca9e
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 |
| |
| |||
263 | 264 |
| |
264 | 265 |
| |
265 | 266 |
| |
266 |
| - | |
267 |
| - | |
268 |
| - | |
269 |
| - | |
270 |
| - | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
271 | 273 |
| |
272 |
| - | |
273 | 274 |
| |
274 | 275 |
| |
| 276 | + | |
| 277 | + | |
| 278 | + | |
275 | 279 |
| |
276 | 280 |
| |
277 | 281 |
| |
278 | 282 |
| |
279 | 283 |
| |
280 |
| - | |
| 284 | + | |
281 | 285 |
| |
282 |
| - | |
283 |
| - | |
284 |
| - | |
285 |
| - | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
286 | 289 |
| |
287 |
| - | |
288 |
| - | |
289 |
| - | |
290 |
| - | |
| 290 | + | |
291 | 291 |
| |
292 |
| - | |
293 |
| - | |
294 |
| - | |
295 |
| - | |
296 |
| - | |
297 |
| - | |
298 |
| - | |
| 292 | + | |
299 | 293 |
| |
| 294 | + | |
| 295 | + | |
300 | 296 |
| |
301 | 297 |
| |
302 | 298 |
| |
303 | 299 |
| |
304 |
| - | |
305 |
| - | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
306 | 309 |
| |
307 | 310 |
| |
308 | 311 |
| |
|
0 commit comments
Comments
(0)