RFID: Fix integer overflow, fix printf usage (#742)
* Fix comparison of constant 300 with expression of type 'uint8_t' is always false rfid-worker.cpp:111 if(validate_counts > (5 * 60)) * Fix format string is not a string literal (potentially insecure) Co-authored-by: Tony Freeman <tonyfreeman@users.noreply.github.com>
This commit is contained in:
parent
89a6c09a7a
commit
a7edebce69
@ -43,6 +43,6 @@ private:
|
|||||||
void sq_write();
|
void sq_write();
|
||||||
void sq_write_start_validate();
|
void sq_write_start_validate();
|
||||||
void sq_write_validate();
|
void sq_write_validate();
|
||||||
uint8_t validate_counts;
|
uint16_t validate_counts;
|
||||||
void sq_write_stop_validate();
|
void sq_write_stop_validate();
|
||||||
};
|
};
|
@ -55,7 +55,7 @@ void lfrfid_cli_read(Cli* cli) {
|
|||||||
printf("Reading RFID...\r\nPress Ctrl+C to abort\r\n");
|
printf("Reading RFID...\r\nPress Ctrl+C to abort\r\n");
|
||||||
while(!cli_cmd_interrupt_received(cli)) {
|
while(!cli_cmd_interrupt_received(cli)) {
|
||||||
if(reader.read(&type, data, data_size)) {
|
if(reader.read(&type, data, data_size)) {
|
||||||
printf(lfrfid_key_get_type_string(type));
|
printf("%s", lfrfid_key_get_type_string(type));
|
||||||
printf(" ");
|
printf(" ");
|
||||||
|
|
||||||
for(uint8_t i = 0; i < lfrfid_key_get_type_data_count(type); i++) {
|
for(uint8_t i = 0; i < lfrfid_key_get_type_data_count(type); i++) {
|
||||||
|
Loading…
Reference in New Issue
Block a user