Bug 37801

Summary: x11 tests xi2 init_window calls memset with sizeof instead of sizeof*
Product: xorg Reporter: Andre Klapper <a9016009>
Component: Server/Input/CoreAssignee: Xorg Project Team <xorg-team>
Status: RESOLVED FIXED QA Contact: Xorg Project Team <xorg-team>
Severity: normal    
Priority: medium CC: peter.hutterer
Version: git   
Hardware: Other   
OS: All   
See Also: https://bugs.meego.com/show_bug.cgi?id=16212
Whiteboard:
i915 platform: i915 features:

Description Andre Klapper 2011-05-31 14:29:05 UTC
Upstreaming from https://bugs.meego.com/show_bug.cgi?id=16212 .

Still applies to current git master codebase in
http://cgit.freedesktop.org/xorg/xserver/tree/test/xi2/protocol-common.c

122 void init_window(WindowPtr window, WindowPtr parent, int id)
123 {
124     memset(window, 0, sizeof(window));

WindowPtr is a parent, you want to use sizeof *window or sizeof Window...
Comment 1 Alan Coopersmith 2011-05-31 14:34:45 UTC
lib/xi is for the client-side libXi, not the code in the Xserver,
reassigning.
Comment 2 Peter Hutterer 2011-05-31 17:31:01 UTC
http://patchwork.freedesktop.org/patch/5657/
Comment 3 Julien Cristau 2011-06-11 03:40:33 UTC
commit 62f1bf96e1ea27e1eff137cb9333f3dd3b014dd0
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Wed Jun 1 10:22:44 2011 +1000

    test: fix memset size for WindowRec (#37801)
    
    X.Org Bug 37801 <http://bugs.freedesktop.org/show_bug.cgi?id=37801>
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
    Reviewed-by: Daniel Stone <daniel@fooishbar.org>
    Reviewed-by: Cyril Brulebois <kibi@debian.org>

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.