Merge "Return correct error code when finish input length is too long." am: 90657bbeab am: efea269a75 am: 18e3e2a66f
am: 67d5ddde7b

Change-Id: I4019d5b2ef9ab44b9447c862da44f5c82155452c