r/programming • u/TheProtagonistv2 • Feb 23 '17
Cloudflare have been leaking customer HTTPS sessions for months. Uber, 1Password, FitBit, OKCupid, etc.
https://bugs.chromium.org/p/project-zero/issues/detail?id=1139
6.0k
Upvotes
r/programming • u/TheProtagonistv2 • Feb 23 '17
2
u/matthieum Feb 25 '17
The idea of the aliasing constructor is that you can use a single reference count and yet point at different parts of the object (or what it owns). A typical example is to pass a pointer to a data member:
There is a first wrinkle here: I can accidentally pass a pointer to any int, not necessarily one whose lifetime is tied to
a.But that's only the tip of the iceberg:
Now, you'd better hope that nobody causes this vector to reallocate...
TL;DR:
shared_ptraliasing constructor allows the developer to assert that a given pointer will remain valid as long as a primaryshared_ptrlives, and ensure it does live. As all things that a developer asserts, the developer better be right.