diff options
author | Ben Noordhuis <info@bnoordhuis.nl> | 2015-01-05 20:44:25 +0100 |
---|---|---|
committer | Ben Noordhuis <info@bnoordhuis.nl> | 2015-01-05 22:25:20 +0100 |
commit | eaed2a11ecf8d4f8a309f42d6bbc72306c01b755 (patch) | |
tree | 59abc7b7d4c1396c5bd60a47f13e694076b5b299 /deps/uv/src/unix/sunos.c | |
parent | 94e147500c5bf457c9101bda8c8020d8ff896708 (diff) | |
download | android-node-v8-eaed2a11ecf8d4f8a309f42d6bbc72306c01b755.tar.gz android-node-v8-eaed2a11ecf8d4f8a309f42d6bbc72306c01b755.tar.bz2 android-node-v8-eaed2a11ecf8d4f8a309f42d6bbc72306c01b755.zip |
deps: update libuv to 1.2.0
PR-URL: https://github.com/iojs/io.js/pull/237
Reviewed-By: Bert Belder <bertbelder@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Diffstat (limited to 'deps/uv/src/unix/sunos.c')
-rw-r--r-- | deps/uv/src/unix/sunos.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/deps/uv/src/unix/sunos.c b/deps/uv/src/unix/sunos.c index d6fb7f4950..ca183a6227 100644 --- a/deps/uv/src/unix/sunos.c +++ b/deps/uv/src/unix/sunos.c @@ -300,11 +300,15 @@ int uv_exepath(char* buffer, size_t* size) { ssize_t res; char buf[128]; - if (buffer == NULL || size == NULL) + if (buffer == NULL || size == NULL || *size == 0) return -EINVAL; snprintf(buf, sizeof(buf), "/proc/%lu/path/a.out", (unsigned long) getpid()); - res = readlink(buf, buffer, *size - 1); + + res = *size - 1; + if (res > 0) + res = readlink(buf, buffer, res); + if (res == -1) return -errno; |