about summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux/tst-readdir64-compat.c
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2018-12-10 16:50:37 +0100
committerFlorian Weimer <fweimer@redhat.com>2018-12-10 16:50:37 +0100
commit5f1ae50a78d3f66b195668f1b863832d85d27f2f (patch)
tree6ddec18300169cb469b0570b61ba36ccff0afb4b /sysdeps/unix/sysv/linux/tst-readdir64-compat.c
parent8c89e6b02d95cb4c0155eb3efc18fbd9c0f4582f (diff)
downloadglibc-5f1ae50a78d3f66b195668f1b863832d85d27f2f.tar.gz
glibc-5f1ae50a78d3f66b195668f1b863832d85d27f2f.tar.xz
glibc-5f1ae50a78d3f66b195668f1b863832d85d27f2f.zip
compat getdents64: Use correct offset for retry [BZ #23972]
d_off is the offset of the *next* entry, not the offset of the current
entry.

(cherry picked from commit 8d20a2f414fa52aceef8a0e3675415df54a840db)
Diffstat (limited to 'sysdeps/unix/sysv/linux/tst-readdir64-compat.c')
-rw-r--r--sysdeps/unix/sysv/linux/tst-readdir64-compat.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sysdeps/unix/sysv/linux/tst-readdir64-compat.c b/sysdeps/unix/sysv/linux/tst-readdir64-compat.c
index 43c4a8477c..cb78bc9be4 100644
--- a/sysdeps/unix/sysv/linux/tst-readdir64-compat.c
+++ b/sysdeps/unix/sysv/linux/tst-readdir64-compat.c
@@ -88,6 +88,10 @@ do_test (void)
       else
         TEST_VERIFY_EXIT (entry_test != NULL);
 
+      /* d_off is never zero because it is the offset of the next
+         entry (not the current entry).  */
+      TEST_VERIFY (entry_reference->d_off > 0);
+
       /* Check that the entries are the same.  */
       TEST_COMPARE_BLOB (entry_reference->d_name,
                          strlen (entry_reference->d_name),