blob: da4d429f697907efe9ea42bb8430b18346890a65 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
$NetBSD: patch-aa,v 1.1 2008/01/29 02:00:22 bjs Exp $
XeviGetVisualInfo: check for null pointer before writing to it, not after
--- src/XEVI.c.orig 2006-07-11 14:05:14.000000000 -0400
+++ 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 */
|