Bug 530485 - meta_window_new shoudl handle the situation when XGetWindowAttributes return 0
meta_window_new shoudl handle the situation when XGetWindowAttributes return 0
Status: RESOLVED FIXED
Product: metacity
Classification: Other
Component: general
2.22.x
Other All
: Normal normal
: ---
Assigned To: Metacity maintainers list
Metacity maintainers list
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2008-04-29 04:19 UTC by Chris Wang
Modified: 2008-04-29 13:37 UTC (History)
1 user (show)

See Also:
GNOME target: ---
GNOME version: 2.21/2.22


Attachments
Suggest fix (589 bytes, patch)
2008-04-29 04:22 UTC, Chris Wang
none Details | Diff | Review
Revised patch (1.49 KB, patch)
2008-04-29 07:09 UTC, Chris Wang
committed Details | Diff | Review

Description Chris Wang 2008-04-29 04:19:59 UTC
Please describe the problem:
Currently in window.c function meta_window_new, we didn't check the return value of XGetWindowAttributes.Although this is occasionally, but if the XGetWindowAttributes returns a 0 due to certain XError, this will cause Metacity 
core dump, which is quite severe. 

I suggest to check the return value of XGetWindowAttributes, and process the situation if it returns a 0

Steps to reproduce:
1. 
2. 
3. 


Actual results:


Expected results:


Does this happen every time?


Other information:
Comment 1 Chris Wang 2008-04-29 04:22:10 UTC
Created attachment 110080 [details] [review]
Suggest fix

This is a suggest fix
Comment 2 Chris Wang 2008-04-29 07:09:48 UTC
Created attachment 110083 [details] [review]
Revised patch

add some consideration of meta_error_trap_pop_with_return
Comment 3 Thomas Thurman 2008-04-29 13:37:13 UTC
That looks a good patch; thanks for catching it.

http://svn.gnome.org/viewvc/metacity?rev=3698&view=rev

Note You need to log in before you can comment on or make changes to this bug.