sapling/eden/fs
Michael Bolin 6f14b7f6d0 Fix "heap-use-after-free" issues in misc.cpp and miscTest.cpp.
Summary:
This was reported by ASAN.

The major issue was that `FakeObjectStore` was returning a copy of a `Tree`,
so it was not the case that the `TreeEntry*` returned by `getEntryForFile()`
was guaranteed to be "owned by" the `Tree* root` that was passed in. To address
this, we change `getEntryForFile()` to now return a copy of the `TreeEntry*`
that it gets back from `getEntryPtr()`. It really comes down to this line:

```
auto entry = currentDirectory->getEntryPtr(piece.basename());
```

because we cannot guarantee that `currentDirectory` will live past the end of
`getEntryForFile()`, so we cannot guarantee that return return value of
`currentDirectory->getEntryPtr()` will, either.

Special thanks to meyering and yfeldblum for helping me debug this.

Reviewed By: simpkins

Differential Revision: D4024627

fbshipit-source-id: 6295e6f2b1d2f544271b2aebad27a4ad3ae04563
2016-10-14 17:53:18 -07:00
..
cli normalize mount paths when doing config look-ups 2016-09-30 19:07:45 -07:00
config Add initial support for hooks akin to Git hooks for Eden. 2016-09-26 13:53:05 -07:00
inodes ensure that we set materialized=true when loading overlay 2016-09-26 13:54:14 -07:00
integration some prep work for hypothesis testing 2016-10-14 07:26:13 -07:00
journal sample the snapshot id in the journal at mount time 2016-09-26 13:52:25 -07:00
model Fix "heap-use-after-free" issues in misc.cpp and miscTest.cpp. 2016-10-14 17:53:18 -07:00
rocksdb Include build files that were inadvertently excluded from the initial export. 2016-05-12 16:08:34 -07:00
service don't crash if getMaterializedEntries() is called with a bad mount point 2016-10-04 11:04:18 -07:00
store Fix "heap-use-after-free" issue reported in FakeObjestStoreTest.cpp. 2016-10-14 15:57:09 -07:00