aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVitaly Chikunov <vt@altlinux.org>2021-02-01 23:04:08 +0300
committerDmitry V. Levin <ldv@altlinux.org>2021-02-01 20:04:08 +0000
commitf9be44c7e6d90cb1fe3a0fbe3cc299ac783f0be8 (patch)
treeb3f7f74875bdc4e60179c4dd3212f9749377174b
parentfd4405747c18463aad98877f277ab5d6eb54f78f (diff)
downloadglibc-f9be44c7e6d90cb1fe3a0fbe3cc299ac783f0be8.tar
glibc-f9be44c7e6d90cb1fe3a0fbe3cc299ac783f0be8.tar.gz
glibc-f9be44c7e6d90cb1fe3a0fbe3cc299ac783f0be8.tar.bz2
glibc-f9be44c7e6d90cb1fe3a0fbe3cc299ac783f0be8.zip
libSegFault: Fix printing signal number [BZ #27249]
Signal number is written into the tail of buf, but printed from the beginning, outputting garbage on the screen. Fix this by printing from the correct position. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org> Reviewed-by: Dmitry V. Levin <ldv@altlinux.org>
-rw-r--r--debug/segfault.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/debug/segfault.c b/debug/segfault.c
index 0a6be8b9d4..1873022db9 100644
--- a/debug/segfault.c
+++ b/debug/segfault.c
@@ -58,7 +58,7 @@ write_strsignal (int fd, int signal)
char buf[30];
char *ptr = _itoa_word (signal, &buf[sizeof (buf)], 10, 0);
WRITE_STRING ("signal ");
- write (fd, buf, &buf[sizeof (buf)] - ptr);
+ write (fd, ptr, &buf[sizeof (buf)] - ptr);
}