Skip to content

Copy all C++ strings to NSString where they're not obviously safe #893

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 8, 2018

Conversation

wilhuff
Copy link
Contributor

@wilhuff wilhuff commented Mar 8, 2018

This fixes a known instance of memory corruption where in
FSTLevelDBMutationQueue, the NSString view was retained for later, and
the incorrect user was used, causing b/74381054.

gRPC does not necessarily copy its string arguments and if our hostname
were configured to a non-default one it's possible that we could corrupt
the host cache too.

All remaining usages of util::WrapNSStringNoCopy are obviously safe:
passed into logging or other known transient usages.

This fixes a known instances of memory corruption where in
FSTLevelDBMutationQueue, the NSString view was retained for later, and
the incorrect user was used, causing b/74381054.

gRPC does not necessarily copy its string argumnets and if our hostname
were configured to a non-default one it's possible that we could corrupt
the host cache too.

All remaining usages of util::WrapNSStringNoCopy are obviously safe:
passed into logging or other known transient usages.
Copy link
Contributor

@mikelehen mikelehen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks!

@wilhuff wilhuff merged commit d44174e into release-4.10.1 Mar 8, 2018
@wilhuff wilhuff deleted the wilhuff/copy-strings branch March 8, 2018 20:36
zxu123 added a commit that referenced this pull request Mar 8, 2018
zxu123 added a commit that referenced this pull request Mar 9, 2018
* Version bumps for Firebase 4.10.1 (#891)

* Minimal fix for b/74357976 (#890)

Fixes b/74357976 which caused unauthenticated users to be unable to reach the Firestore backend and updates the changelog.

* Copy all C++ strings to NSString where they're not obviously safe (#893)

This fixes a known instances of memory corruption where in
FSTLevelDBMutationQueue, the NSString view was retained for later, and
the incorrect user was used, causing b/74381054.

gRPC does not necessarily copy its string argumnets and if our hostname
were configured to a non-default one it's possible that we could corrupt
the host cache too.

All remaining usages of util::WrapNSStringNoCopy are obviously safe:
passed into logging or other known transient usages.

* fix lint
minafarid pushed a commit to minafarid/firebase-ios-sdk that referenced this pull request Jun 6, 2018
…rebase#893)

This fixes a known instances of memory corruption where in
FSTLevelDBMutationQueue, the NSString view was retained for later, and
the incorrect user was used, causing b/74381054.

gRPC does not necessarily copy its string argumnets and if our hostname
were configured to a non-default one it's possible that we could corrupt
the host cache too.

All remaining usages of util::WrapNSStringNoCopy are obviously safe:
passed into logging or other known transient usages.
minafarid pushed a commit to minafarid/firebase-ios-sdk that referenced this pull request Jun 6, 2018
* Version bumps for Firebase 4.10.1 (firebase#891)

* Minimal fix for b/74357976 (firebase#890)

Fixes b/74357976 which caused unauthenticated users to be unable to reach the Firestore backend and updates the changelog.

* Copy all C++ strings to NSString where they're not obviously safe (firebase#893)

This fixes a known instances of memory corruption where in
FSTLevelDBMutationQueue, the NSString view was retained for later, and
the incorrect user was used, causing b/74381054.

gRPC does not necessarily copy its string argumnets and if our hostname
were configured to a non-default one it's possible that we could corrupt
the host cache too.

All remaining usages of util::WrapNSStringNoCopy are obviously safe:
passed into logging or other known transient usages.

* fix lint
@firebase firebase locked and limited conversation to collaborators Nov 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants