Skip to content

Commit

Permalink
Fix buffer-overflow under long path name
Browse files Browse the repository at this point in the history
  • Loading branch information
Teka101 committed Jan 12, 2018
1 parent bae212e commit d3805e2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion SftpServer/FileSystem.c
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ int FSReadLink(const char *file, char *readLink, int sizeofReadLink)
FSDestroyPath(path);
return SSH2_FX_PERMISSION_DENIED;
}
len = readlink(path->realPath, readLink, sizeofReadLink);
len = readlink(path->realPath, readLink, sizeofReadLink - 1);
DEBUG((MYLOG_DEBUG, "[FSReadLink]realPath:'%s' sizeofReadLink:%i => %i", path->realPath, sizeofReadLink, len));

if (len == -1)
Expand Down

0 comments on commit d3805e2

Please sign in to comment.