Skip to content

Commit

Permalink
Fix off-by-one error in setOverrideMods (strlcpy copies n-1 bytes). F…
Browse files Browse the repository at this point in the history
…ixes ticket:3567.
  • Loading branch information
haoNoQ committed May 30, 2013
1 parent 68e2bf1 commit 87cade1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main.cpp
Expand Up @@ -261,7 +261,7 @@ void setOverrideMods(char * modlist)
while ((nextmod = strstr(curmod, ", ")) && i<MAX_MODS-2)
{
override_mods[i] = (char *)malloc(nextmod-curmod+1);
strlcpy(override_mods[i], curmod, nextmod-curmod);
strlcpy(override_mods[i], curmod, nextmod-curmod+1);
override_mods[i][nextmod-curmod] = '\0';
curmod = nextmod + 2;
i++;
Expand Down

0 comments on commit 87cade1

Please sign in to comment.