<html>
    <head>
      <base href="https://bugs.freedesktop.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - xcb_send_event() reads beyond end of argument / is hard to use correctly"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=99946">99946</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>xcb_send_event() reads beyond end of argument / is hard to use correctly
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>XCB
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Other
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Library
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>xcb@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>psychon@znc.in
          </td>
        </tr>

        <tr>
          <th>QA Contact</th>
          <td>xcb@lists.freedesktop.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre><a href="https://bugreports.qt.io/browse/QTBUG-56518">https://bugreports.qt.io/browse/QTBUG-56518</a> is about valgrind warnings that
occur in Qt. The code in question does basically:

    xcb_unmap_notify_event_t event;
    set all fields of event;
    xcb_send_event(c, false, root, mask, &event);

The problem here is that sizeof(event) is 16 while xcb_send_event() expects 32
bytes of event data. So the argument needs to be "something bigger". This is
quite unintuitive and it seems like everyone using xcb_send_event() is getting
this wrong. (I would claim that I know may way around XCB and I did not know
this!)

Can there be a version of xcb_send_event() which gets a length argument? Are
there any other ideas on how this could be made safer or more obvious?</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the QA Contact for the bug.</li>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>