Skip to content

Commit

Permalink
Fix buffer overflow issue in getrealpath() function.
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianlopezroche committed Jun 18, 2024
1 parent a93ad47 commit 732404d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion getrealpath.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ char *getrealpath(const char *path, unsigned int options)
return 0;
}

scratch = malloc(strlen(link) + strlen(basename) + 1);
scratch = malloc(strlen(link) + strlen(basename) + 2);
if (scratch == 0)
{
free(basename);
Expand Down

0 comments on commit 732404d

Please sign in to comment.