forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit99b0c5d
committed
Avoid direct C access to possibly-null pg_subscription_rel.srsublsn.
This coding technique is unsafe, since we'd be accessing off the endof the tuple if the field is null. SIGSEGV is pretty improbable, butperhaps not impossible. Also, returning garbage for the LSN doesn'tseem like a great idea, even if callers aren't looking at it today.Also update docs to point out explicitly thatpg_subscription.subslotname and pg_subscription_rel.srsublsncan be null.Perhaps we should mark these two fields BKI_FORCE_NULL, so thatthey'd be correctly labeled in databases that are initdb'd in thefuture. But we can't force that for existing databases, and onbalance it's not too clear that having a mix of different catalogcontents in the field would be wise.Apply to v10 (where this code came in) through v12. Alreadyfixed in v13 and HEAD.Discussion:https://postgr.es/m/732838.1595278439@sss.pgh.pa.us1 parent855195a commit99b0c5d
File tree
3 files changed
+33
-7
lines changed- doc/src/sgml
- src
- backend/catalog
- include/catalog
3 files changed
+33
-7
lines changedLines changed: 6 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
6695 | 6695 |
| |
6696 | 6696 |
| |
6697 | 6697 |
| |
6698 |
| - | |
6699 |
| - | |
| 6698 | + | |
| 6699 | + | |
| 6700 | + | |
6700 | 6701 |
| |
6701 | 6702 |
| |
6702 | 6703 |
| |
| |||
6778 | 6779 |
| |
6779 | 6780 |
| |
6780 | 6781 |
| |
6781 |
| - | |
| 6782 | + | |
| 6783 | + | |
| 6784 | + | |
6782 | 6785 |
| |
6783 | 6786 |
| |
6784 | 6787 |
| |
|
Lines changed: 16 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
457 | 457 |
| |
458 | 458 |
| |
459 | 459 |
| |
| 460 | + | |
| 461 | + | |
460 | 462 |
| |
461 | 463 |
| |
462 | 464 |
| |
463 | 465 |
| |
464 | 466 |
| |
465 | 467 |
| |
466 |
| - | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
467 | 474 |
| |
468 | 475 |
| |
469 | 476 |
| |
| |||
509 | 516 |
| |
510 | 517 |
| |
511 | 518 |
| |
| 519 | + | |
| 520 | + | |
512 | 521 |
| |
513 | 522 |
| |
514 | 523 |
| |
515 | 524 |
| |
516 | 525 |
| |
517 | 526 |
| |
518 |
| - | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
519 | 533 |
| |
520 | 534 |
| |
521 | 535 |
| |
|
Lines changed: 11 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
34 | 34 |
| |
35 | 35 |
| |
36 | 36 |
| |
37 |
| - | |
38 |
| - | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
39 | 48 |
| |
40 | 49 |
| |
41 | 50 |
| |
|
0 commit comments
Comments
(0)