mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-14 02:27:26 -07:00
fix: possible overrun
This commit is contained in:
parent
528e8fe395
commit
f59e67c00c
1 changed files with 5 additions and 2 deletions
|
@ -237,10 +237,13 @@ static char *asn1_oid_description(const char *oid, bool with_group_desc) {
|
|||
static char res[300];
|
||||
memset(res, 0x00, sizeof(res));
|
||||
|
||||
strcpy(fname, get_my_executable_directory());
|
||||
size_t len = strlen(get_my_executable_directory());
|
||||
if ( len > 300 ) len = 299;
|
||||
|
||||
strncpy(fname, get_my_executable_directory(), len);
|
||||
strcat(fname, "crypto/oids.json");
|
||||
if (access(fname, F_OK) < 0) {
|
||||
strcpy(fname, get_my_executable_directory());
|
||||
strncpy(fname, get_my_executable_directory(), len);
|
||||
strcat(fname, "oids.json");
|
||||
if (access(fname, F_OK) < 0) {
|
||||
goto error; // file not found
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue