Skip to content

Commit 249b355

Browse files
fntlnzgnosek
authored andcommitted
fix: bound home resolver for real path
Signed-off-by: Lorenzo Fontana <[email protected]>
1 parent c047508 commit 249b355

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

userspace/libsinsp/utils.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ char* realpath_ex(const char *path, char *buff)
7878
if(*path=='~' && (home = getenv("HOME")))
7979
{
8080
char s[PATH_MAX];
81-
return realpath(strcat(strncpy(s, home, sizeof(s)), path+1), buff);
81+
return realpath(strncat(strncpy(s, home, sizeof(s)), path+1, sizeof(path)+1), buff);
8282
}
8383
else
8484
{

0 commit comments

Comments
 (0)