mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-14 18:48:13 -07:00
Decoder must not write more bit than requested
This commit is contained in:
parent
6c6734feb3
commit
c7d7680cd6
1 changed files with 12 additions and 4 deletions
|
@ -687,11 +687,15 @@ static int em4x70_receive(uint8_t *bits, size_t length) {
|
|||
// pulse length 1.5 -> 2 bits + flip edge detection
|
||||
if (edge == FALLING_EDGE) {
|
||||
bits[bit_pos++] = 0;
|
||||
bits[bit_pos++] = 0;
|
||||
if (bit_pos < length) {
|
||||
bits[bit_pos++] = 0;
|
||||
}
|
||||
edge = RISING_EDGE;
|
||||
} else {
|
||||
bits[bit_pos++] = 1;
|
||||
bits[bit_pos++] = 1;
|
||||
if (bit_pos < length) {
|
||||
bits[bit_pos++] = 1;
|
||||
}
|
||||
edge = FALLING_EDGE;
|
||||
}
|
||||
|
||||
|
@ -700,10 +704,14 @@ static int em4x70_receive(uint8_t *bits, size_t length) {
|
|||
// pulse length of 2 -> two bits
|
||||
if (edge == FALLING_EDGE) {
|
||||
bits[bit_pos++] = 0;
|
||||
bits[bit_pos++] = 1;
|
||||
if (bit_pos < length) {
|
||||
bits[bit_pos++] = 1;
|
||||
}
|
||||
} else {
|
||||
bits[bit_pos++] = 1;
|
||||
bits[bit_pos++] = 0;
|
||||
if (bit_pos < length) {
|
||||
bits[bit_pos++] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue