mirror of
git://sourceware.org/git/glibc.git
synced 2025-03-06 20:58:33 +01:00
tst-*glob*: Do not check d_name size
Posix says that d_name is of unspecified size, and sizeof(d_name) should not be used. It is indeed only 1-byte long in bits/dirent.h. We can instead explictly provide the actual allocated size to __strcpy_chk.
This commit is contained in:
parent
d97a12704b
commit
5e4435f960
2 changed files with 2 additions and 2 deletions
|
@ -173,7 +173,7 @@ my_readdir (void *gdir)
|
|||
|
||||
dir->d.d_type = filesystem[dir->idx].type;
|
||||
|
||||
strcpy (dir->d.d_name, filesystem[dir->idx].name);
|
||||
__strcpy_chk (dir->d.d_name, filesystem[dir->idx].name, NAME_MAX);
|
||||
|
||||
++dir->idx;
|
||||
|
||||
|
|
|
@ -222,7 +222,7 @@ my_readdir (void *gdir)
|
|||
|
||||
dir->d.d_type = filesystem[dir->idx].type;
|
||||
|
||||
strcpy (dir->d.d_name, filesystem[dir->idx].name);
|
||||
__strcpy_chk (dir->d.d_name, filesystem[dir->idx].name, NAME_MAX);
|
||||
|
||||
if (test_verbose > 0)
|
||||
printf ("info: my_readdir ({ level: %d, idx: %ld })"
|
||||
|
|
Loading…
Add table
Reference in a new issue