Merge pull request #6594

4e6d587 Fix incorrect lenght of command INS_PREFIX_HASH (grydz)
This commit is contained in:
luigi1111 2020-06-19 15:59:50 -05:00
commit 79f4af310e
No known key found for this signature in database
GPG Key ID: F4ACA0183641E010

View File

@ -1468,8 +1468,8 @@ namespace hw {
offset = set_command_header(INS_PREFIX_HASH,2,cnt);
len = pref_length - pref_offset;
//options
if (len > (BUFFER_SEND_SIZE-7)) {
len = BUFFER_SEND_SIZE-7;
if (len > (BUFFER_SEND_SIZE-offset-3)) {
len = BUFFER_SEND_SIZE-offset-3;
this->buffer_send[offset] = 0x80;
} else {
this->buffer_send[offset] = 0x00;