1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-04-11 11:22:01 +02:00

Fix segfault on invalid GCS key file.

This commit is contained in:
David Steele 2021-10-22 17:19:16 -04:00
parent cb36fec102
commit 2cea005f74
2 changed files with 22 additions and 1 deletions

View File

@ -29,6 +29,18 @@
<p>Allow <quote>global</quote> as a stanza prefix.</p>
</release-item>
<release-item>
<github-issue id="1536"/>
<release-item-contributor-list>
<release-item-ideator id="henrik.feldt"/>
<release-item-contributor id="david.steele"/>
<release-item-reviewer id="stephen.frost"/>
</release-item-contributor-list>
<p>Fix segfault on invalid <proper>GCS</proper> key file.</p>
</release-item>
</release-bug-list>
<release-improvement-list>
@ -10376,6 +10388,11 @@
<contributor-id type="github">crunchyheath</contributor-id>
</contributor>
<contributor id="henrik.feldt">
<contributor-name-display>Henrik Feldt</contributor-name-display>
<contributor-id type="github">haf</contributor-id>
</contributor>
<contributor id="ibrahim.edib.kokdemir">
<contributor-name-display>Ibrahim Edib Kokdemir</contributor-name-display>
<contributor-id type="github">Edib</contributor-id>

View File

@ -966,7 +966,11 @@ storageGcsNew(
KeyValue *kvKey = jsonToKv(strNewBuf(storageGetP(storageNewReadP(storagePosixNewP(FSLASH_STR), key))));
driver->credential = varStr(kvGet(kvKey, GCS_JSON_CLIENT_EMAIL_VAR));
driver->privateKey = varStr(kvGet(kvKey, GCS_JSON_PRIVATE_KEY_VAR));
driver->authUrl = httpUrlNewParseP(varStr(kvGet(kvKey, GCS_JSON_TOKEN_URI_VAR)), .type = httpProtocolTypeHttps);
const String *const uri = varStr(kvGet(kvKey, GCS_JSON_TOKEN_URI_VAR));
CHECK(driver->credential != NULL && driver->privateKey != NULL && uri != NULL);
driver->authUrl = httpUrlNewParseP(uri, .type = httpProtocolTypeHttps);
driver->authClient = httpClientNew(
tlsClientNew(