some coverity fixes plus fix fdx help (#328)

* coverity fixes

cmdhflegic- indications are the i in calls to data_buf[i] could = 1052
and overflow the array.
cmdhfmfhard - +1 to add space for string null terminator - should we add
the 0 terminator value too?
reveng.c - memory leak
util.c - fix potential overflow of array buf[]
util_posix.c - possible integer overflow

* fix help errors

* fix sprint_hex_ascii

again
and this function is not even used anywhere... yet...
This commit is contained in:
marshmellow42 2017-06-20 18:25:08 -04:00 committed by pwpiwi
commit bf8243475b
6 changed files with 11 additions and 9 deletions

View file

@ -47,7 +47,7 @@ static int CmdHelp(const char *Cmd);
int usage_lf_fdx_clone(void){
PrintAndLog("Clone a FDX-B animal tag to a T55x7 tag.");
PrintAndLog("Usage: lf animal clone [h] <country id> <animal id> <Q5>");
PrintAndLog("Usage: lf fdx clone [h] <country id> <animal id> <Q5>");
PrintAndLog("Options:");
PrintAndLog(" h : This help");
PrintAndLog(" <country id> : Country id");
@ -66,13 +66,13 @@ int usage_lf_fdx_sim(void) {
PrintAndLog("Enables simulation of FDX-B animal tag");
PrintAndLog("Simulation runs until the button is pressed or another USB command is issued.");
PrintAndLog("");
PrintAndLog("Usage: lf animal sim [h] <country id> <animal id>");
PrintAndLog("Usage: lf fdx sim [h] <country id> <animal id>");
PrintAndLog("Options:");
PrintAndLog(" h : This help");
PrintAndLog(" <country id> : Country ID");
PrintAndLog(" <animal id> : Animal ID");
PrintAndLog("");
PrintAndLog("Sample: lf animal sim 999 112233");
PrintAndLog("Sample: lf fdx sim 999 112233");
return 0;
}
// clearing the topbit needed for the preambl detection.