Skip to content

Commit

Permalink
Fixed buffer initialization errors, as reported in http://www.proxmar…
Browse files Browse the repository at this point in the history
  • Loading branch information
holiman committed Apr 8, 2015
1 parent 2c772e6 commit 83602af
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion armsrc/iclass.c
Expand Up @@ -1675,7 +1675,8 @@ uint8_t handshakeIclassTag(uint8_t *card_data)
// Reader iClass Anticollission
void ReaderIClass(uint8_t arg0) {

uint8_t card_data[6 * 8]={0xFF};
uint8_t card_data[6 * 8]={0};
memset(card_data, 0xFF, sizeof(card_data));
uint8_t last_csn[8]={0};

//Read conf block CRC(0x01) => 0xfa 0x22
Expand Down
2 changes: 1 addition & 1 deletion client/cmdhfmf.c
Expand Up @@ -434,7 +434,7 @@ int CmdHF14AMfRestore(const char *Cmd)
{
uint8_t sectorNo,blockNo;
uint8_t keyType = 0;
uint8_t key[6] = {0xFF};
uint8_t key[6] = {0xFF,0xFF,0xFF,0xFF,0xFF,0xFF};

This comment has been minimized.

Copy link
@pwpiwi

pwpiwi Apr 8, 2015

Contributor

needs one 0xFF more (key[6]has 7 bytes)

This comment has been minimized.

Copy link
@iceman1001

iceman1001 Apr 8, 2015

Member

hm, zero index for accessing it, and actual size when initialising...

This comment has been minimized.

Copy link
@pwpiwi

pwpiwi Apr 8, 2015

Contributor

Forget about my comment. It was nonsense. Of course key[6]has six bytes only and the initialization is perfectly fine.

This comment has been minimized.

Copy link
@holiman

holiman Apr 8, 2015

Author Contributor

The comment was obviously nonsense, however, when someone with your authority makes such a claim... well, I was forced to think hard about it :)

This comment has been minimized.

Copy link
@iceman1001

iceman1001 Apr 8, 2015

Member

It could be that @pwpiwi has developed a sense of humor.

This comment has been minimized.

Copy link
@pwpiwi

pwpiwi Apr 8, 2015

Contributor

Of course this was by purpose 😉. I only wanted to show @iceman1001 that not everything coming from me is godlike 😇

uint8_t bldata[16] = {0x00};
uint8_t keyA[40][6];
uint8_t keyB[40][6];
Expand Down

2 comments on commit 83602af

@iceman1001
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You always will be godlike to me, @pwpiwi

@buggii
Copy link

@buggii buggii commented on 83602af Apr 8, 2015 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.