Skip to content

Commit

Permalink
Fix [bad6cc213d]: A format string vulnerability in Tcl nmakehelp.c al…
Browse files Browse the repository at this point in the history
…lows code execution via a crated file.

Also change a memcpy() to a memmove(), because the range could be overlapping
  • Loading branch information
jan.nijtmans committed Jun 22, 2021
1 parent e809cad commit 30db6ce
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions win/nmakehlp.c
Expand Up @@ -537,7 +537,7 @@ GetVersionFromFile(
++q;
}

memcpy(szBuffer, p, q - p);
memmove(szBuffer, p, q - p);
szBuffer[q-p] = 0;
szResult = szBuffer;
break;
Expand Down Expand Up @@ -674,7 +674,7 @@ SubstituteFile(
memcpy(szBuffer, szCopy, sizeof(szCopy));
}
}
printf(szBuffer);
printf("%s", szBuffer);
}

list_free(&substPtr);
Expand Down

0 comments on commit 30db6ce

Please sign in to comment.