Skip to content

Commit

Permalink
Merge pull request #38 from jphickey/fix-37-stringops
Browse files Browse the repository at this point in the history
Fix #37, termination on strncpy
  • Loading branch information
astrogeco committed May 8, 2020
2 parents f9741ed + 3f68b98 commit 32a9171
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions elf2cfetbl.c
Original file line number Diff line number Diff line change
Expand Up @@ -936,13 +936,15 @@ int32 ProcessCmdLineOptions(int ArgumentCount, char *Arguments[])
if ((Arguments[i][0] == '-') && (Arguments[i][1] == 't'))
{
// Extract the Table Name Override
strncpy(TableName, &Arguments[i][2], 38);
strncpy(TableName, &Arguments[i][2], sizeof(TableName)-1);
TableName[sizeof(TableName)-1] = 0;
TableNameOverride = true;
}
else if ((Arguments[i][0] == '-') && (Arguments[i][1] == 'd'))
{
// Extract the Description Override
strncpy(Description, &Arguments[i][2], 32);
strncpy(Description, &Arguments[i][2], sizeof(Description)-1);
Description[sizeof(Description)-1] = 0;
DescriptionOverride = true;
}
else if ((Arguments[i][0] == '-') && (Arguments[i][1] == 's'))
Expand Down

0 comments on commit 32a9171

Please sign in to comment.