Merge "Return correct error code when finish input length is too long."
am: 90657bbeab

Change-Id: I96ea16c713efcc51533b9aafab3624b0070b3dc3