Fix integer overflows in recovery procedure.

Bug: 26960931
Change-Id: Ieae45caccfb4728fcf514f0d920976585d8e6caf
(cherry picked from commit 4f2df162c6ab4a71ca86e4b38735b681729c353b)
(cherry picked from commit 1273956e69a7d1d5b636f269050b446e0ced3f9b)
1 file changed