diff --git a/app/src/main/java/dgca/verifier/app/android/verification/VerificationViewModel.kt b/app/src/main/java/dgca/verifier/app/android/verification/VerificationViewModel.kt index 04055732..d0feaba2 100644 --- a/app/src/main/java/dgca/verifier/app/android/verification/VerificationViewModel.kt +++ b/app/src/main/java/dgca/verifier/app/android/verification/VerificationViewModel.kt @@ -153,7 +153,15 @@ class VerificationViewModel @Inject constructor( val plainInput = prefixValidationService.decode(code, verificationResult) val compressedCose = base45Service.decode(plainInput, verificationResult) - val cose = compressorService.decode(compressedCose, verificationResult) + val cose: ByteArray? = compressorService.decode(compressedCose, verificationResult) + + if (cose == null) { + Timber.d("Verification failed: Too many bytes read") + return InnerVerificationResult( + greenCertificateData = greenCertificateData, + isApplicableCode = isApplicableCode + ) + } val coseData = coseService.decode(cose, verificationResult) if (coseData == null) {