Commit 6d2c71e2 authored by Manoj Gupta's avatar Manoj Gupta Committed by chrome-bot
Browse files

update_engine: Fix a stack use after scope issue.

GetCStr() returns the contents to a local string returned by Get().
The string is destroyed after the call to GetCStr() so the pointer
passed to atoi() is not valid.
Change Get() to return a reference instead so that it will stay valid
for lifetime of atoi().

BUG=chromium:808686
TEST=No more asan complains.

Change-Id: Icc62064f4f3382a29ccbd36ca90f9952cf149364
Reviewed-on: https://chromium-review.googlesource.com/899512


Commit-Ready: Manoj Gupta <manojgupta@chromium.org>
Tested-by: default avatarManoj Gupta <manojgupta@chromium.org>
Reviewed-by: default avatarAmin Hassani <ahassani@chromium.org>
parent f94b643f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment