diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2023-08-03 21:15:39 +0200 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2023-08-03 22:41:45 +0200 |
commit | 5e4435f960bb681cbea853fb41043fabeeaea1b4 (patch) | |
tree | 3ab577f3d55764735a816ebbffabbd818bcc8a43 /posix/tst-gnuglob-skeleton.c | |
parent | d97a12704bca5c2c326d856a69cd847c89784ae9 (diff) | |
download | glibc-5e4435f960bb681cbea853fb41043fabeeaea1b4.tar.gz glibc-5e4435f960bb681cbea853fb41043fabeeaea1b4.tar.xz glibc-5e4435f960bb681cbea853fb41043fabeeaea1b4.zip |
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.
Diffstat (limited to 'posix/tst-gnuglob-skeleton.c')
-rw-r--r-- | posix/tst-gnuglob-skeleton.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/posix/tst-gnuglob-skeleton.c b/posix/tst-gnuglob-skeleton.c index 557cfcbd2a..998fc2d94d 100644 --- a/posix/tst-gnuglob-skeleton.c +++ b/posix/tst-gnuglob-skeleton.c @@ -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 })" |