Skip to content

Commit

Permalink
Set the null terminator in the targetFile buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
chisandrei authored and akgrant43 committed Sep 27, 2023
1 parent b66dd58 commit 28b81b1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions extracted/plugins/FileAttributesPlugin/src/unix/faSupport.c
Original file line number Diff line number Diff line change
Expand Up @@ -478,8 +478,10 @@ char targetFile[FA_PATH_MAX];
if (S_ISLNK(statBuf.st_mode)) {
/* This is a symbolic link, provide the target filename */
status = readlink(faGetPlatPath(aFaPath), targetFile, FA_PATH_MAX);
if (status >= 0)
targetOop = pathNameToOop(targetFile); } }
if (status >= 0) {
targetFile[status] = 0;
targetOop = pathNameToOop(targetFile); } } }

else {
status = stat(faGetPlatPath(aFaPath), &statBuf);
if (status)
Expand Down

0 comments on commit 28b81b1

Please sign in to comment.