Merge "Return correct error code when finish input length is too long."