forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit2e82d0b
committed
Prevent datebsearch() from crashing on base == NULL && nel == 0.
Normally nel == 0 works okay because the initial value of "last" will beless than "base"; but if "base" is zero then the calculation wraps aroundand we have a very large (unsigned) value for "last", so that the loop canbe entered and we get a SIGSEGV on a bogus pointer.This is certainly the proximate cause of the recent reports of Windowsbuilds crashing on 'infinity'::timestamp --- evidently, they're either notsetting an active timezonetktbl, or setting an empty one. It's not yetclear to me why it's only happening on Windows and not happening on anybuildfarm member. But even if that's due to some bug elsewhere, it seemswise for this function to not choke on the powerup values oftimezonetktbl/sztimezonetktbl.I also changed the copy of this code in ecpglib, although I am not surewhether it's exposed to a similar hazard.Per report and stack trace from Richard Broersma.1 parent7ff7711 commit2e82d0b
File tree
2 files changed
+34
-28
lines changed- src
- backend/utils/adt
- interfaces/ecpg/pgtypeslib
2 files changed
+34
-28
lines changedLines changed: 17 additions & 14 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3569 | 3569 |
| |
3570 | 3570 |
| |
3571 | 3571 |
| |
3572 |
| - | |
3573 |
| - | |
3574 |
| - | |
3575 |
| - | |
3576 |
| - | |
| 3572 | + | |
3577 | 3573 |
| |
3578 |
| - | |
3579 |
| - | |
3580 |
| - | |
| 3574 | + | |
| 3575 | + | |
| 3576 | + | |
| 3577 | + | |
| 3578 | + | |
3581 | 3579 |
| |
3582 |
| - | |
| 3580 | + | |
| 3581 | + | |
3583 | 3582 |
| |
3584 |
| - | |
| 3583 | + | |
| 3584 | + | |
| 3585 | + | |
| 3586 | + | |
| 3587 | + | |
| 3588 | + | |
| 3589 | + | |
| 3590 | + | |
| 3591 | + | |
3585 | 3592 |
| |
3586 |
| - | |
3587 |
| - | |
3588 |
| - | |
3589 |
| - | |
3590 | 3593 |
| |
3591 | 3594 |
| |
3592 | 3595 |
| |
|
Lines changed: 17 additions & 14 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
512 | 512 |
| |
513 | 513 |
| |
514 | 514 |
| |
515 |
| - | |
516 |
| - | |
517 |
| - | |
518 |
| - | |
519 |
| - | |
| 515 | + | |
520 | 516 |
| |
521 |
| - | |
522 |
| - | |
523 |
| - | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
524 | 522 |
| |
525 |
| - | |
| 523 | + | |
| 524 | + | |
526 | 525 |
| |
527 |
| - | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
528 | 535 |
| |
529 |
| - | |
530 |
| - | |
531 |
| - | |
532 |
| - | |
533 | 536 |
| |
534 | 537 |
| |
535 | 538 |
| |
|
0 commit comments
Comments
(0)