_kern_read_link() no longer null-terminates the read string. Fixes

loading of symlinked libraries.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24467 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2008-03-19 14:09:03 +00:00
parent 694f0665c0
commit c57db7d007
+2 -1
View File
@@ -139,13 +139,14 @@ try_open_executable(const char *dir, int dirLength, const char *name,
if (S_ISLNK(stat.st_mode)) {
char buffer[PATH_MAX];
size_t length = PATH_MAX;
size_t length = PATH_MAX - 1;
char *lastSlash;
// it's a link, indeed
status = _kern_read_link(-1, path, buffer, &length);
if (status < B_OK)
return status;
buffer[length] = '\0';
lastSlash = strrchr(path, '/');
if (buffer[0] != '/' && lastSlash != NULL) {