summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@sun.com>2007-11-28 17:29:28 -0800
committerAlan Coopersmith <alan.coopersmith@sun.com>2007-11-28 17:29:28 -0800
commit249daf0d8a044a97d053c957ab45445c159d31e4 (patch)
tree32b4ee3a4810aeb0c038b352d00d5e2316d33fbc
parenta7d211f6e3ded98c79e7be73253a51958d3e98db (diff)
downloadxorg-lib-libXext-249daf0d8a044a97d053c957ab45445c159d31e4.tar.gz
XeviGetVisualInfo: check for null pointer before writing to it, not after
-rw-r--r--src/XEVI.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/XEVI.c b/src/XEVI.c
index dd796a4..c7cc7f7 100644
--- a/src/XEVI.c
+++ b/src/XEVI.c
@@ -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 */