Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #37, termination on strncpy #38

Merged
merged 1 commit into from
May 8, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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