add length check to get_version (#545)

This commit is contained in:
Carl Wallace
2023-12-20 09:42:27 -05:00
committed by GitHub
parent 3e31fe8663
commit c0f3a2f841
+1 -1
View File
@@ -92,7 +92,7 @@ impl<'tx> Transaction<'tx> {
// get version from device
let response = Apdu::new(Ins::GetVersion).transmit(self, 261)?;
if !response.is_success() {
if !response.is_success() || response.data().is_empty() {
return Err(Error::GenericError);
}