Skip to content

Commit

Permalink
More validation
Browse files Browse the repository at this point in the history
  • Loading branch information
Cacodemon345 committed Feb 26, 2024
1 parent 1be08f9 commit 8363144
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/device/novell_cardkey.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,14 @@ void* novell_cardkey_init(const device_t* info)
if (sernumstr[i] > '8' || sernumstr[i] < '0')
sernumstr[i] = '0';
}
if (sernumstr[8] > 'F' || sernumstr[8] < '0')
sernumstr[8] = '0';
if (sernumstr[9] > 'F' || sernumstr[9] < '0')
sernumstr[9] = '0';
if (sernumstr[10] > 'F' || sernumstr[10] < '0')
sernumstr[10] = '0';
if (sernumstr[11] > 'F' || sernumstr[11] < '0')
sernumstr[11] = '0';
sernumstr[12] = 0;
strncpy(cardkey->serial_number_str, sernumstr, sizeof(sernumstr));
io_sethandler(NOVELL_KEYCARD_ADDR, NOVELL_KEYCARD_ADDRLEN, novell_cardkey_read, NULL, NULL, NULL, NULL, NULL, cardkey);
Expand Down

0 comments on commit 8363144

Please sign in to comment.