Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 9a75c19

Browse filesBrowse files
author
Sofia Kopikova
committed
PGPRO-11098 add null-pointer check to ptrack_set_init_lsn() function
When ptrack extension is added to shared_preload_libraries, but ptrack.map size is 0, we may encounter segmantation fault when calling ptrack_backup_checkpoint_request_hook() function. This commit adds additional null-pointer checks to ptrack_set_init_lsn() function called by ptrack_backup_checkpoint_request_hook() to avoid this segfault
1 parent 08cf80d commit 9a75c19
Copy full SHA for 9a75c19

File tree

1 file changed

+4
-0
lines changed
Filter options

1 file changed

+4
-0
lines changed

‎engine.c

Copy file name to clipboardExpand all lines: engine.c
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -659,6 +659,10 @@ XLogRecPtr
659659
ptrack_set_init_lsn(void)
660660
{
661661
XLogRecPtr new_lsn;
662+
663+
if (ptrack_map_size == 0 || ptrack_map == NULL)
664+
return InvalidXLogRecPtr;
665+
662666
if (RecoveryInProgress())
663667
new_lsn = GetXLogReplayRecPtr(NULL);
664668
else

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.