firebase / firebase-cpp-sdk

Firebase C++ SDK
http://firebase.google.com
Apache License 2.0
276 stars 115 forks source link

Fix Storage usage of invalid pointers. #1574

Closed jonsimantov closed 5 months ago

jonsimantov commented 5 months ago

Description

Provide details of the change, and generalize the change in the PR title above.

As reported in #1570, if StorageReference::GetFile() is called from a non-UI thread, the const char* path passed in is not preserved and could have been deleted by the calling code once the FIRStorage native call occurs in the main thread later.

Fix this by creating the URL from the local file path outside outside of the thread dispatch block. (Similar to what PutFile() already does.)


Testing

Describe how you've tested these changes. Link any manually triggered Integration tests or CPP binary SDK Packaging Github Action workflows, if applicable.

Integration tests in this PR.


Type of Change

Place an x the applicable box:

Notes

github-actions[bot] commented 5 months ago

✅  Integration test succeeded!

Requested by @jonsimantov on commit 507dfa2294e17fe6c680571a45cab026b7a50f9d Last updated: Tue Apr 23 14:24 PDT 2024 View integration test log & download artifacts