From 43414194b80f8dd62f94c26719c1fe0ea8ff56fd Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sat, 2 Feb 2002 19:21:26 +0000 Subject: [PATCH] (_dl_get_origin): Avoid writing over array boundary. --- sysdeps/unix/sysv/linux/dl-origin.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sysdeps/unix/sysv/linux/dl-origin.c b/sysdeps/unix/sysv/linux/dl-origin.c index 9149a0a4de2..9303144f29a 100644 --- a/sysdeps/unix/sysv/linux/dl-origin.c +++ b/sysdeps/unix/sysv/linux/dl-origin.c @@ -42,7 +42,7 @@ _dl_get_origin (void) { /* We can use this value. */ char *last_slash = strrchr (linkval, '/'); - result = (char *) malloc (last_slash - linkval + 1); + result = (char *) malloc (last_slash - linkval + 2); if (result == NULL) result = (char *) -1; else if (last_slash == linkval) -- 2.47.2