Skip to content

Commit

Permalink
fix: bound home resolver for real path
Browse files Browse the repository at this point in the history
Signed-off-by: Lorenzo Fontana <[email protected]>
  • Loading branch information
fntlnz authored and gnosek committed Aug 6, 2019
1 parent c047508 commit 249b355
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion userspace/libsinsp/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ char* realpath_ex(const char *path, char *buff)
if(*path=='~' && (home = getenv("HOME")))
{
char s[PATH_MAX];
return realpath(strcat(strncpy(s, home, sizeof(s)), path+1), buff);
return realpath(strncat(strncpy(s, home, sizeof(s)), path+1, sizeof(path)+1), buff);
}
else
{
Expand Down

0 comments on commit 249b355

Please sign in to comment.