mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-02-23 07:37:23 +08:00
fix dynamic-stack-buffer-overflow
This commit is contained in:
parent
1cdddc270f
commit
8998b0b46c
1 changed files with 4 additions and 1 deletions
|
@ -11,6 +11,7 @@
|
|||
#include "ndef.h"
|
||||
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "ui.h"
|
||||
#include "util.h" // sprint_hex...
|
||||
|
@ -637,7 +638,7 @@ static int ndefDecodePayload(NDEFHeader_t *ndef) {
|
|||
break;
|
||||
}
|
||||
|
||||
char begin[ndef->TypeLen];
|
||||
char *begin = calloc(ndef->TypeLen + 1,sizeof(char));
|
||||
memcpy(begin, ndef->Type, ndef->TypeLen);
|
||||
str_lower(begin);
|
||||
|
||||
|
@ -651,6 +652,8 @@ static int ndefDecodePayload(NDEFHeader_t *ndef) {
|
|||
ndefDecodeMime_bt(ndef);
|
||||
}
|
||||
|
||||
free(begin);
|
||||
begin = NULL;
|
||||
break;
|
||||
}
|
||||
case tnfAbsoluteURIRecord:
|
||||
|
|
Loading…
Reference in a new issue