forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit2cb9f2c
committed
Check return values of sensitive system library calls.
PostgreSQL already checked the vast majority of these, missing thishandful that nearly cannot fail. If putenv() failed with ENOMEM inpg_GSS_recvauth(), authentication would proceed with the wrong keytabfile. If strftime() returned zero in cache_locale_time(), using theunspecified buffer contents could lead to information exposure or acrash. Back-patch to 9.0 (all supported versions).Other unchecked calls to these functions, especially those in frontendcode, pose negligible security concern. This patch does not addressthem. Nonetheless, it is always better to check return values whosespecification provides for indicating an error.In passing, fix an off-by-one error in strftime_win32()'s invocation ofWideCharToMultiByte(). Upon retrieving a value of exactly MAX_L10N_DATAbytes, strftime_win32() would overrun the caller's buffer by one byte.MAX_L10N_DATA is chosen to exceed the length of every possible value, sothe vulnerable scenario probably does not arise.Security:CVE-2015-31661 parente58f042 commit2cb9f2c
2 files changed
+48
-33
lines changedLines changed: 4 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1026 | 1026 |
| |
1027 | 1027 |
| |
1028 | 1028 |
| |
1029 |
| - | |
| 1029 | + | |
| 1030 | + | |
| 1031 | + | |
| 1032 | + | |
1030 | 1033 |
| |
1031 | 1034 |
| |
1032 | 1035 |
| |
1033 | 1036 |
| |
1034 | 1037 |
| |
1035 | 1038 |
| |
1036 |
| - | |
1037 |
| - | |
1038 | 1039 |
| |
1039 | 1040 |
| |
1040 | 1041 |
| |
|
Lines changed: 44 additions & 30 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
544 | 544 |
| |
545 | 545 |
| |
546 | 546 |
| |
547 |
| - | |
| 547 | + | |
| 548 | + | |
548 | 549 |
| |
549 | 550 |
| |
| 551 | + | |
550 | 552 |
| |
551 | 553 |
| |
552 | 554 |
| |
553 | 555 |
| |
554 | 556 |
| |
555 |
| - | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
556 | 565 |
| |
557 | 566 |
| |
558 | 567 |
| |
559 |
| - | |
560 |
| - | |
| 568 | + | |
| 569 | + | |
561 | 570 |
| |
562 | 571 |
| |
563 | 572 |
| |
564 |
| - | |
| 573 | + | |
| 574 | + | |
565 | 575 |
| |
566 | 576 |
| |
567 | 577 |
| |
| |||
584 | 594 |
| |
585 | 595 |
| |
586 | 596 |
| |
587 |
| - | |
| 597 | + | |
588 | 598 |
| |
589 | 599 |
| |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
590 | 624 |
| |
591 | 625 |
| |
592 | 626 |
| |
| |||
597 | 631 |
| |
598 | 632 |
| |
599 | 633 |
| |
600 |
| - | |
601 |
| - | |
602 | 634 |
| |
603 | 635 |
| |
604 | 636 |
| |
| |||
645 | 677 |
| |
646 | 678 |
| |
647 | 679 |
| |
648 |
| - | |
649 |
| - | |
650 |
| - | |
651 |
| - | |
652 |
| - | |
653 |
| - | |
654 |
| - | |
655 |
| - | |
656 |
| - | |
657 |
| - | |
658 |
| - | |
| 680 | + | |
| 681 | + | |
659 | 682 |
| |
660 | 683 |
| |
661 | 684 |
| |
662 | 685 |
| |
663 | 686 |
| |
664 | 687 |
| |
665 | 688 |
| |
666 |
| - | |
667 |
| - | |
668 |
| - | |
669 |
| - | |
670 |
| - | |
671 |
| - | |
672 |
| - | |
673 |
| - | |
674 |
| - | |
675 |
| - | |
676 |
| - | |
| 689 | + | |
| 690 | + | |
677 | 691 |
| |
678 | 692 |
| |
679 | 693 |
| |
|
0 commit comments
Comments
(0)