You've already forked pgbackrest
mirror of
https://github.com/pgbackrest/pgbackrest.git
synced 2026-06-20 01:17:49 +02:00
Fix possible segfault in page checksum error message.
The STRDEF definition of plural is out of scope in the error message just below it, which may lead to either garbage in the log message or a crash with SIGSEGV. This is particularly visible with pg_tde, which encrypts tables: if pgbackrest is run with checksum enabled, it tries to emit this message for all encrypted files. Fix by using simple char * constants in the error message.
This commit is contained in:
@@ -1,5 +1,18 @@
|
||||
<release date="XXXX-XX-XX" version="2.57.0dev" title="Under Development">
|
||||
<release-core-list>
|
||||
<release-bug-list>
|
||||
<release-item>
|
||||
<github-pull-request id="2675"/>
|
||||
|
||||
<release-item-contributor-list>
|
||||
<release-item-contributor id="zsolt.parragi"/>
|
||||
<release-item-reviewer id="david.steele"/>
|
||||
</release-item-contributor-list>
|
||||
|
||||
<p>Fix possible segfault in page checksum error message.</p>
|
||||
</release-item>
|
||||
</release-bug-list>
|
||||
|
||||
<release-improvement-list>
|
||||
<release-item>
|
||||
<github-pull-request id="2661"/>
|
||||
|
||||
@@ -1225,3 +1225,8 @@
|
||||
<contributor-name-display>yummyliu</contributor-name-display>
|
||||
<contributor-id type="github">yummyliu</contributor-id>
|
||||
</contributor>
|
||||
|
||||
<contributor id="zsolt.parragi">
|
||||
<contributor-name-display>Zsolt Parragi</contributor-name-display>
|
||||
<contributor-id type="github">dutow</contributor-id>
|
||||
</contributor>
|
||||
|
||||
@@ -1568,12 +1568,12 @@ backupJobResult(
|
||||
}
|
||||
|
||||
// Make message plural when appropriate
|
||||
const String *const plural = errorTotalMin > 1 ? STRDEF("s") : EMPTY_STR;
|
||||
const char *const plural = errorTotalMin > 1 ? "s" : "";
|
||||
|
||||
// ??? Update formatting after migration
|
||||
LOG_WARN_FMT(
|
||||
"invalid page checksum%s found in file %s at page%s %s", strZ(plural), strZ(fileLog),
|
||||
strZ(plural), strZ(error));
|
||||
"invalid page checksum%s found in file %s at page%s %s", plural, strZ(fileLog), plural,
|
||||
strZ(error));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user