diff options
Diffstat (limited to 'libc/bionic')
| -rw-r--r-- | libc/bionic/malloc_leak.c | 5 | ||||
| -rw-r--r-- | libc/bionic/ssp.c | 4 |
2 files changed, 5 insertions, 4 deletions
diff --git a/libc/bionic/malloc_leak.c b/libc/bionic/malloc_leak.c index 305f954..ad1d2b4 100644 --- a/libc/bionic/malloc_leak.c +++ b/libc/bionic/malloc_leak.c @@ -665,8 +665,9 @@ void* chk_realloc(void* mem, size_t bytes) } if (new_buffer) { - size_t size = (bytes < old_bytes)?(bytes):(old_bytes); - memcpy(new_buffer, mem, size); + if (bytes > old_bytes) + bytes = old_bytes; + memcpy(new_buffer, mem, bytes); chk_free(mem); } diff --git a/libc/bionic/ssp.c b/libc/bionic/ssp.c index 20794f4..f83b2a4 100644 --- a/libc/bionic/ssp.c +++ b/libc/bionic/ssp.c @@ -76,9 +76,9 @@ void __stack_chk_fail(void) sigprocmask(SIG_BLOCK, &sigmask, NULL); /* Use /proc/self/exe link to obtain the program name for logging - * purposes. If it's not available, we set it to "unknown" */ + * purposes. If it's not available, we set it to "<unknown>" */ if ((count = readlink("/proc/self/exe", path, sizeof(path) - 1)) == -1) { - strlcpy(path, "unknown", sizeof(path)); + strlcpy(path, "<unknown>", sizeof(path)); } else { path[count] = '\0'; } |
