mirror of
https://github.com/nsacyber/Hardware-and-Firmware-Security-Guidance
synced 2025-08-29 21:57:40 +00:00
Update esl-parser.c
Fix string initialization mistakes (I am rusty at C programming!).
This commit is contained in:
parent
7f38552bd4
commit
3241d1b18c
@ -99,7 +99,7 @@ int parseHashes(bool debug, bool silent, FILE *infile, unsigned int hashcount, u
|
|||||||
records = 0,
|
records = 0,
|
||||||
readcount = 0;
|
readcount = 0;
|
||||||
unsigned char *buf = NULL,
|
unsigned char *buf = NULL,
|
||||||
outfilenameEX[strlen(outfilename + 4)];
|
outfilenameEX[MAX_FILENAME_LENGTH + 4] = "";
|
||||||
FILE *outfile = NULL;
|
FILE *outfile = NULL;
|
||||||
|
|
||||||
//read the structure sizing and record count info
|
//read the structure sizing and record count info
|
||||||
@ -111,7 +111,6 @@ int parseHashes(bool debug, bool silent, FILE *infile, unsigned int hashcount, u
|
|||||||
if(debug) printf("Parsing hash list\n listsize %i, header %i, sigsize %i, records %i\n", listsize, headersize, sigsize, records);
|
if(debug) printf("Parsing hash list\n listsize %i, header %i, sigsize %i, records %i\n", listsize, headersize, sigsize, records);
|
||||||
|
|
||||||
//add the txt extension to the filename
|
//add the txt extension to the filename
|
||||||
outfilenameEX[0] = '\0';
|
|
||||||
strcat(outfilenameEX, outfilename);
|
strcat(outfilenameEX, outfilename);
|
||||||
strcat(outfilenameEX, ".txt");
|
strcat(outfilenameEX, ".txt");
|
||||||
|
|
||||||
@ -166,7 +165,7 @@ int parseCerts(bool debug, bool silent, FILE *infile, unsigned int certcount, un
|
|||||||
records = 0,
|
records = 0,
|
||||||
readcount = 0;
|
readcount = 0;
|
||||||
unsigned char *buf = NULL,
|
unsigned char *buf = NULL,
|
||||||
outfilenameEX[MAX_FILENAME_LENGTH + 7],
|
outfilenameEX[MAX_FILENAME_LENGTH + 7] = "",
|
||||||
temp[4];
|
temp[4];
|
||||||
FILE *outfile = NULL;
|
FILE *outfile = NULL;
|
||||||
|
|
||||||
@ -179,7 +178,6 @@ int parseCerts(bool debug, bool silent, FILE *infile, unsigned int certcount, un
|
|||||||
if(debug) printf("Parsing cert list\n listsize %i, header %i, sigsize %i, records %i\n", listsize, headersize, sigsize, records);
|
if(debug) printf("Parsing cert list\n listsize %i, header %i, sigsize %i, records %i\n", listsize, headersize, sigsize, records);
|
||||||
|
|
||||||
//null terminate the outfile name
|
//null terminate the outfile name
|
||||||
outfilenameEX[0] = '\0';
|
|
||||||
strcat(outfilenameEX, outfilename);
|
strcat(outfilenameEX, outfilename);
|
||||||
|
|
||||||
//make a buffer big enough to contaiin each cert
|
//make a buffer big enough to contaiin each cert
|
||||||
|
Loading…
x
Reference in New Issue
Block a user