diff options
author | Alan Coopersmith <alan.coopersmith@sun.com> | 2007-11-28 17:29:28 -0800 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@sun.com> | 2007-11-28 17:29:28 -0800 |
commit | 249daf0d8a044a97d053c957ab45445c159d31e4 (patch) | |
tree | 32b4ee3a4810aeb0c038b352d00d5e2316d33fbc | |
parent | a7d211f6e3ded98c79e7be73253a51958d3e98db (diff) |
XeviGetVisualInfo: check for null pointer before writing to it, not after
-rw-r--r-- | src/XEVI.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -117,10 +117,13 @@ Status XeviGetVisualInfo( register int n_data, visualIndex, vinfoIndex; Bool isValid; XeviCheckExtension (dpy, info, 0); + if (!n_info_return || !evi_return) { + return BadValue; + } *n_info_return = 0; *evi_return = NULL; vinfo = XGetVisualInfo(dpy, 0, NULL, &sz_info); - if (!vinfo || !evi_return) { + if (!vinfo) { return BadValue; } if (!n_visual || !visual) { /* copy the all visual */ |