- Notifications
You must be signed in to change notification settings - Fork5
Commit00eb036
committed
Fix potential memory clobber in tsvector_concat().
tsvector_concat() allocated its result workspace using the "conservative"estimate of the sum of the two input tsvectors' sizes. Unfortunately thatwasn't so conservative as all that, because it supposed that the number ofpad bytes required could not grow. Which it can, as per test case fromJesper Krogh, if there's a mix of lexemes with positions and lexemeswithout them in the input data. The fix is to assume that we might adda not-previously-present pad byte for each and every lexeme in the twoinputs; which really is conservative, but it doesn't seem worthwhile totry to be more precise.This is an aboriginal bug in tsvector_concat, so back-patch to allversions containing it.1 parent4027181 commit00eb036
1 file changed
+30
-6
lines changedLines changed: 30 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
341 | 341 |
| |
342 | 342 |
| |
343 | 343 |
| |
344 |
| - | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
345 | 347 |
| |
346 | 348 |
| |
347 | 349 |
| |
348 | 350 |
| |
| 351 | + | |
349 | 352 |
| |
350 | 353 |
| |
351 | 354 |
| |
| |||
369 | 372 |
| |
370 | 373 |
| |
371 | 374 |
| |
372 |
| - | |
373 |
| - | |
374 |
| - | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
375 | 390 |
| |
| 391 | + | |
376 | 392 |
| |
377 | 393 |
| |
378 | 394 |
| |
| |||
514 | 530 |
| |
515 | 531 |
| |
516 | 532 |
| |
517 |
| - | |
518 |
| - | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
519 | 540 |
| |
520 | 541 |
| |
| 542 | + | |
| 543 | + | |
| 544 | + | |
521 | 545 |
| |
522 | 546 |
| |
523 | 547 |
| |
|
0 commit comments
Comments
(0)