libbe_build: fix unterminated string in BEntry::set. Fixes #10686.
Signed-off-by: Stephan Aßmus <superstippi@gmx.de>
This commit is contained in:
parent
b167307526
commit
181948a678
@ -985,10 +985,11 @@ BEntry::set(int dirFD, const char *path, bool traverse)
|
||||
// we need to traverse the symlink
|
||||
if (--linkLimit < 0)
|
||||
return B_LINK_LIMIT;
|
||||
size_t bufferSize = B_PATH_NAME_LENGTH;
|
||||
size_t bufferSize = B_PATH_NAME_LENGTH - 1;
|
||||
error = _kern_read_link(dirFD, leafName, tmpPath, &bufferSize);
|
||||
if (error < 0)
|
||||
return error;
|
||||
tmpPath[bufferSize] = '\0';
|
||||
path = tmpPath;
|
||||
// next round...
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user