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:Manoj Gupta <manojgupta@chromium.org> Reviewed-by:
Amin Hassani <ahassani@chromium.org>
Loading
Please sign in to comment