mirror of
https://sourceware.org/git/glibc.git
synced 2024-12-25 20:21:07 +00:00
Fix off-by-one when reading link name in sprof
This commit is contained in:
parent
a9ae54a136
commit
10fb0bfab1
@ -1,3 +1,7 @@
|
||||
2011-11-04 Andreas Schwab <schwab@redhat.com>
|
||||
|
||||
* elf/sprof.c (load_shobj): Fix off-by-one when reading link name.
|
||||
|
||||
2011-11-03 Andreas Schwab <schwab@redhat.com>
|
||||
|
||||
* nscd/nscd.c (main): Don't start AVC thread until credentials are
|
||||
|
@ -597,7 +597,7 @@ load_shobj (const char *name)
|
||||
char origprocname[sizeof (procpath) + sizeof (int) * 3];
|
||||
snprintf (origprocname, sizeof (origprocname), procpath, fd);
|
||||
char *origlink = (char *) alloca (PATH_MAX);
|
||||
ssize_t n = readlink (origprocname, origlink, PATH_MAX);
|
||||
ssize_t n = readlink (origprocname, origlink, PATH_MAX - 1);
|
||||
if (n == -1)
|
||||
goto no_debuginfo;
|
||||
origlink[n] = '\0';
|
||||
|
Loading…
Reference in New Issue
Block a user