You've already forked pgbackrest
mirror of
https://github.com/pgbackrest/pgbackrest.git
synced 2025-07-05 00:28:52 +02:00
Use strNewZ() in cases where STRDEF() assignment goes out of scope.
If a variable assigned with STRDEF() is referenced out of scope of the STRDEF() assignment then the value is undefined. Luckily most of the instances are in tests but there is one in the core code. It is not clear if this is a live bug or not but it certainly needs to be fixed. Found with -fsanitize=address.
This commit is contained in:
@ -1748,7 +1748,7 @@ testRun(void)
|
||||
manifestResume = manifestNewInternal();
|
||||
manifestResume->pub.info = infoNew(NULL);
|
||||
manifestResume->pub.data.backupType = backupTypeFull;
|
||||
manifestResume->pub.data.backupLabel = STRDEF("20191003-105320F");
|
||||
manifestResume->pub.data.backupLabel = strNewZ("20191003-105320F");
|
||||
manifestResume->pub.data.pgVersion = PG_VERSION_12;
|
||||
}
|
||||
OBJ_NEW_END();
|
||||
|
Reference in New Issue
Block a user