crosvm/gpu_display
Zach Reizner 92e75f0e2a gpu_display: fix use after free for the wayland socket path
Using .map in the way it was caused the CString to get moved into the closure
and then dropped by that closure. The returned pointer is then used in
dwl_context_setup after it was freed by the drop.

This change fixes that first by using .as_ref() before calling .map to
prevent the move. As an additional safeguard, some optional types were
added to the closure to make sure a reference to the CString was being
handled instead of a moved CString.

TEST=vmc start --enable-gpu termina
BUG=chromium:988082

Change-Id: I58c2c002f08688ecd85715d9cd45085dffb32457
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1721615
Tested-by: Zach Reizner <zachr@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Auto-Submit: Zach Reizner <zachr@chromium.org>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Zach Reizner <zachr@chromium.org>
2019-07-27 03:50:21 +00:00
..
examples gpu_display: add X11 backend 2019-07-25 22:15:48 +00:00
protocol gpu_display: provides wayland based output for virtio-gpu 2018-07-09 15:48:21 -07:00
src gpu_display: fix use after free for the wayland socket path 2019-07-27 03:50:21 +00:00
build.rs edition: Remove extern crate lines 2019-04-15 02:06:08 -07:00
Cargo.toml gpu_display: add X11 backend 2019-07-25 22:15:48 +00:00