From bf25a3db96fd9a9d22ad78f62bd1710fc5866c27 Mon Sep 17 00:00:00 2001
From: Jessica Hamilton <jessica.l.hamilton@gmail.com>
Date: Mon, 17 Mar 2014 16:19:35 +0000
Subject: [PATCH] libbe_build: fix unterminated string in BEntry::set. Fixes
#10686.
---
src/build/libbe/storage/Entry.cpp | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/build/libbe/storage/Entry.cpp b/src/build/libbe/storage/Entry.cpp
index 2f6accf..93dd8f8 100644
a
|
b
|
BEntry::set(int dirFD, const char *path, bool traverse)
|
985 | 985 | // we need to traverse the symlink |
986 | 986 | if (--linkLimit < 0) |
987 | 987 | return B_LINK_LIMIT; |
988 | | size_t bufferSize = B_PATH_NAME_LENGTH; |
| 988 | size_t bufferSize = B_PATH_NAME_LENGTH - 1; |
989 | 989 | error = _kern_read_link(dirFD, leafName, tmpPath, &bufferSize); |
990 | 990 | if (error < 0) |
991 | 991 | return error; |
| 992 | tmpPath[bufferSize] = '\0'; |
992 | 993 | path = tmpPath; |
993 | 994 | // next round... |
994 | 995 | } |