forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit78b7aaa
committed
Clean up some lack-of-STRICT issues in the core code, too.
A scan for missed proisstrict markings in the core code turned upthese functions:brin_summarize_new_valuespg_stat_reset_single_table_counterspg_stat_reset_single_function_counterspg_create_logical_replication_slotpg_create_physical_replication_slotpg_drop_replication_slotThe first three of these take OID, so a null argument will normally looklike a zero to them, resulting in "ERROR: could not open relation with OID0" for brin_summarize_new_values, and no action for the pg_stat_reset_XXXfunctions. The other three will dump core on a null argument, though thisis mitigated by the fact that they won't do so until after checking thatthe caller is superuser or has rolreplication privilege.In addition, the pg_logical_slot_get/peek[_binary]_changes family wasintentionally marked nonstrict, but failed to make nullness checks on allthe arguments; so again a null-pointer-dereference crash is possible butonly for superusers and rolreplication users.Add the missing ARGISNULL checks to the latter functions, and mark theformer functions as strict in pg_proc. Make that change in the backbranches too, even though we can't force initdb there, just so thatinstallations initdb'd in future won't have the issue. Since none of thesebugs rise to the level of security issues (and indeed the pg_stat_reset_XXXfunctions hardly misbehave at all), it seems sufficient to do this.In addition, fix some order-of-operations oddities in the slot_get_changesfamily, mostly cosmetic, but not the part that moves the function's lastfew operations into the PG_TRY block. As it stood, there was significantrisk for an error to exit without clearing historical information fromthe system caches.The slot_get_changes bugs go back to 9.4 where that code was introduced.Back-patch appropriate subsets of the pg_proc changes into all activebranches, as well.1 parentacbdda4 commit78b7aaa
File tree
2 files changed
+45
-47
lines changed- src
- backend/replication/logical
- include/catalog
2 files changed
+45
-47
lines changedLines changed: 40 additions & 42 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
274 | 274 |
| |
275 | 275 |
| |
276 | 276 |
| |
277 |
| - | |
| 277 | + | |
278 | 278 |
| |
279 | 279 |
| |
280 |
| - | |
281 | 280 |
| |
282 | 281 |
| |
283 | 282 |
| |
284 |
| - | |
285 | 283 |
| |
286 | 284 |
| |
287 |
| - | |
288 | 285 |
| |
289 |
| - | |
290 | 286 |
| |
291 | 287 |
| |
292 | 288 |
| |
293 | 289 |
| |
294 | 290 |
| |
295 | 291 |
| |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
296 | 302 |
| |
297 | 303 |
| |
298 | 304 |
| |
| |||
303 | 309 |
| |
304 | 310 |
| |
305 | 311 |
| |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
306 | 318 |
| |
307 | 319 |
| |
308 | 320 |
| |
| |||
322 | 334 |
| |
323 | 335 |
| |
324 | 336 |
| |
325 |
| - | |
326 |
| - | |
327 |
| - | |
328 |
| - | |
329 |
| - | |
330 |
| - | |
331 |
| - | |
332 | 337 |
| |
333 | 338 |
| |
334 | 339 |
| |
| 340 | + | |
| 341 | + | |
335 | 342 |
| |
336 | 343 |
| |
337 | 344 |
| |
| |||
380 | 387 |
| |
381 | 388 |
| |
382 | 389 |
| |
383 |
| - | |
384 | 390 |
| |
385 | 391 |
| |
386 | 392 |
| |
| |||
442 | 448 |
| |
443 | 449 |
| |
444 | 450 |
| |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
445 | 468 |
| |
446 | 469 |
| |
447 | 470 |
| |
| |||
452 | 475 |
| |
453 | 476 |
| |
454 | 477 |
| |
455 |
| - | |
456 |
| - | |
457 |
| - | |
458 |
| - | |
459 |
| - | |
460 |
| - | |
461 |
| - | |
462 |
| - | |
463 |
| - | |
464 |
| - | |
465 |
| - | |
466 |
| - | |
467 |
| - | |
468 |
| - | |
469 |
| - | |
470 |
| - | |
471 |
| - | |
472 | 478 |
| |
473 | 479 |
| |
474 | 480 |
| |
| |||
478 | 484 |
| |
479 | 485 |
| |
480 | 486 |
| |
481 |
| - | |
482 |
| - | |
483 |
| - | |
| 487 | + | |
484 | 488 |
| |
485 | 489 |
| |
486 | 490 |
| |
| |||
489 | 493 |
| |
490 | 494 |
| |
491 | 495 |
| |
492 |
| - | |
493 |
| - | |
494 |
| - | |
| 496 | + | |
495 | 497 |
| |
496 | 498 |
| |
497 | 499 |
| |
| |||
500 | 502 |
| |
501 | 503 |
| |
502 | 504 |
| |
503 |
| - | |
504 |
| - | |
505 |
| - | |
| 505 | + | |
506 | 506 |
| |
507 | 507 |
| |
508 | 508 |
| |
| |||
511 | 511 |
| |
512 | 512 |
| |
513 | 513 |
| |
514 |
| - | |
515 |
| - | |
516 |
| - | |
| 514 | + | |
517 | 515 |
|
Lines changed: 5 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2812 | 2812 |
| |
2813 | 2813 |
| |
2814 | 2814 |
| |
2815 |
| - | |
| 2815 | + | |
2816 | 2816 |
| |
2817 |
| - | |
| 2817 | + | |
2818 | 2818 |
| |
2819 | 2819 |
| |
2820 | 2820 |
| |
| |||
4956 | 4956 |
| |
4957 | 4957 |
| |
4958 | 4958 |
| |
4959 |
| - | |
| 4959 | + | |
4960 | 4960 |
| |
4961 |
| - | |
| 4961 | + | |
4962 | 4962 |
| |
4963 | 4963 |
| |
4964 | 4964 |
| |
4965 |
| - | |
| 4965 | + | |
4966 | 4966 |
| |
4967 | 4967 |
| |
4968 | 4968 |
| |
|
0 commit comments
Comments
(0)