Commit 7f42350
committed
Avoid null pointer dereference if error result lacks SQLSTATE.
Although error results received from the backend should always have
a SQLSTATE field, ones generated by libpq won't, making this code
vulnerable to a crash after, say, untimely loss of connection.
Noted by Coverity.
Oversight in commit 403a3d9. Back-patch to 9.5, as that was.1 parent b17ff07 commit 7f42350
1 file changed
+8
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
540 | 540 | | |
541 | 541 | | |
542 | 542 | | |
543 | | - | |
544 | | - | |
545 | | - | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
546 | 546 | | |
547 | 547 | | |
548 | 548 | | |
| |||
569 | 569 | | |
570 | 570 | | |
571 | 571 | | |
572 | | - | |
| 572 | + | |
| 573 | + | |
573 | 574 | | |
574 | 575 | | |
575 | 576 | | |
576 | 577 | | |
577 | | - | |
578 | | - | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
579 | 581 | | |
580 | 582 | | |
581 | 583 | | |
| |||
0 commit comments