[haiku-commits] haiku: hrev47024 - src/build/libbe/storage

  • From: superstippi@xxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Mon, 17 Mar 2014 18:22:26 +0100 (CET)

hrev47024 adds 1 changeset to branch 'master'
old head: b167307526897db52743daa0aeffe2a0041abaa8
new head: 181948a6787802cc2795b739d6f32681968e27c2
overview: http://cgit.haiku-os.org/haiku/log/?qt=range&q=181948a+%5Eb167307

----------------------------------------------------------------------------

181948a: libbe_build: fix unterminated string in BEntry::set. Fixes #10686.
  
  Signed-off-by: Stephan Aßmus <superstippi@xxxxxx>

                         [ Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx> ]

----------------------------------------------------------------------------

Revision:    hrev47024
Commit:      181948a6787802cc2795b739d6f32681968e27c2
URL:         http://cgit.haiku-os.org/haiku/commit/?id=181948a
Author:      Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx>
Date:        Mon Mar 17 16:19:35 2014 UTC
Committer:   Stephan Aßmus <superstippi@xxxxxx>
Commit-Date: Mon Mar 17 17:21:39 2014 UTC

Ticket:      https://dev.haiku-os.org/ticket/10686

----------------------------------------------------------------------------

1 file changed, 2 insertions(+), 1 deletion(-)
src/build/libbe/storage/Entry.cpp | 3 ++-

----------------------------------------------------------------------------

diff --git a/src/build/libbe/storage/Entry.cpp 
b/src/build/libbe/storage/Entry.cpp
index 2f6accf..93dd8f8 100644
--- a/src/build/libbe/storage/Entry.cpp
+++ b/src/build/libbe/storage/Entry.cpp
@@ -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...
                }


Other related posts: