]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
(_dl_get_origin): Avoid writing over array boundary.
authorUlrich Drepper <drepper@redhat.com>
Sat, 2 Feb 2002 19:21:26 +0000 (19:21 +0000)
committerUlrich Drepper <drepper@redhat.com>
Sat, 2 Feb 2002 19:21:26 +0000 (19:21 +0000)
sysdeps/unix/sysv/linux/dl-origin.c

index 9149a0a4de2bac03507b886ada3dc5fb80422511..9303144f29a3c071dc4928ea0214ae5a578f6166 100644 (file)
@@ -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)