timmerk / libfreefare

Automatically exported from code.google.com/p/libfreefare
Other
0 stars 0 forks source link

Some functions in mifare_classic.c apparently don't check input data #23

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Most functions in mifare_classic.c contain a little prelude to check the input 
data for sanity:

    ASSERT_ACTIVE (tag);
    ASSERT_MIFARE_CLASSIC (tag);

Some other functions don't do this. I found that at least the following 
functions don't check the state of tag:

    mifare_classic_get_trailer_block_permission
    mifare_classic_get_data_block_permission
    mifare_classic_format_sector

Perhaps I am in err about this, but if the libfreefare really does not perform 
any checks here, this might be a bug. Perhaps the problem also affects other 
tag types.

Original issue reported on code.google.com by fuz...@gmail.com on 18 Mar 2014 at 1:59

GoogleCodeExporter commented 9 years ago
Sounds like a good idea indeed.
Feel free to submit a patch if you've time to work on it.
Thanks

Original comment by yob...@gmail.com on 19 Mar 2014 at 6:09