]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Fix epoll_ctl setting of array event and data fields.
authorMark Wielaard <mark@klomp.org>
Tue, 18 Aug 2020 21:58:55 +0000 (23:58 +0200)
committerMark Wielaard <mark@klomp.org>
Tue, 18 Aug 2020 21:58:55 +0000 (23:58 +0200)
Fix for https://bugs.kde.org/show_bug.cgi?id=422623 in commit ecf5ba119
epoll_ctl warns for uninitialized padding on non-amd64 64bit arches
contained a bug. A pointer to an array is not a pointer to a pointer to
an array. Found by a Fedora user:
https://bugzilla.redhat.com/show_bug.cgi?id=1844778#c10

coregrind/m_syswrap/syswrap-linux.c

index 0850487e909781e47cb66c4cc6d54ed22c55a9aa..3f488795a655bed3cbae75eab022cfd44ec59477 100644 (file)
@@ -2115,11 +2115,11 @@ static void epoll_post_helper ( ThreadId tid, SyscallArgs* arrghs,
    vg_assert(SUCCESS);
    if (RES > 0) {
       Int i;
-      struct vki_epoll_event **events = (struct vki_epoll_event**)(Addr)ARG2;
+      struct vki_epoll_event *events = (struct vki_epoll_event*)(Addr)ARG2;
       for (i = 0; i < RES; i++) {
          /* Assume both events and data are set (data is user space only). */
-         POST_FIELD_WRITE(events[i]->events);
-         POST_FIELD_WRITE(events[i]->data);
+         POST_FIELD_WRITE(events[i].events);
+         POST_FIELD_WRITE(events[i].data);
       }
    }
 }