summaryrefslogtreecommitdiffstats
path: root/x11vnc/xwrappers.c
diff options
context:
space:
mode:
Diffstat (limited to 'x11vnc/xwrappers.c')
-rw-r--r--x11vnc/xwrappers.c36
1 files changed, 32 insertions, 4 deletions
diff --git a/x11vnc/xwrappers.c b/x11vnc/xwrappers.c
index 0b70705..4c6982b 100644
--- a/x11vnc/xwrappers.c
+++ b/x11vnc/xwrappers.c
@@ -117,6 +117,7 @@ int guess_bits_per_color(int bits_per_pixel) {
int XFlush_wr(Display *disp) {
#if NO_X11
+ if (!disp) {}
return 1;
#else
if (disp) {
@@ -157,6 +158,7 @@ Status XShmGetImage_wr(Display *disp, Drawable d, XImage *image, int x, int y,
#if LIBVNCSERVER_HAVE_XSHM
return XShmGetImage(disp, d, image, x, y, mask);
#else
+ if (!disp || !d || !image || !x || !y || !mask) {}
return (Status) 0;
#endif
}
@@ -169,6 +171,7 @@ XImage *XShmCreateImage_wr(Display* disp, Visual* vis, unsigned int depth,
return XShmCreateImage(disp, vis, depth, format, data, shminfo,
width, height);
#else
+ if (!disp || !vis || !depth || !format || !data || !shminfo || !width || !height) {}
return (XImage *) 0;
#endif
}
@@ -177,6 +180,7 @@ Status XShmAttach_wr(Display *disp, XShmSegmentInfo *shminfo) {
#if LIBVNCSERVER_HAVE_XSHM
return XShmAttach(disp, shminfo);
#else
+ if (!disp || !shminfo) {}
return (Status) 0;
#endif
}
@@ -185,6 +189,7 @@ Status XShmDetach_wr(Display *disp, XShmSegmentInfo *shminfo) {
#if LIBVNCSERVER_HAVE_XSHM
return XShmDetach(disp, shminfo);
#else
+ if (!disp || !shminfo) {}
return (Status) 0;
#endif
}
@@ -193,6 +198,7 @@ Bool XShmQueryExtension_wr(Display *disp) {
#if LIBVNCSERVER_HAVE_XSHM
return XShmQueryExtension(disp);
#else
+ if (!disp) {}
return False;
#endif
}
@@ -202,6 +208,7 @@ Bool XShmQueryExtension_wr(Display *disp) {
XImage *xreadscreen(Display *disp, Drawable d, int x, int y,
unsigned int width, unsigned int height, Bool show_cursor) {
#if NO_X11
+ if (!disp || !d || !x || !y || !width || !height || !show_cursor) {}
return NULL;
#else
@@ -231,6 +238,7 @@ XImage *XGetSubImage_wr(Display *disp, Drawable d, int x, int y,
int format, XImage *dest_image, int dest_x, int dest_y) {
#if NO_X11
nox11_exit(1);
+ if (!disp || !d || !x || !y || !width || !height || !plane_mask || !format || !dest_image || !dest_x || !dest_y) {}
return NULL;
#else
ADJUST_ROOTSHIFT
@@ -264,6 +272,7 @@ XImage *XGetImage_wr(Display *disp, Drawable d, int x, int y,
unsigned int width, unsigned int height, unsigned long plane_mask,
int format) {
#if NO_X11
+ if (!disp || !d || !x || !y || !width || !height || !plane_mask || !format) {}
nox11_exit(1);
return NULL;
#else
@@ -309,6 +318,7 @@ XImage *XCreateImage_wr(Display *disp, Visual *visual, unsigned int depth,
#if NO_X11
nox11_exit(1);
+ if (!disp || !visual || !depth || !format || !offset || !data || !width || !height || !width || !bitmap_pad || !bytes_per_line) {}
return NULL;
#else
if (overlay) {
@@ -589,6 +599,7 @@ void init_track_keycode_state(void) {
static void upup_downdown_warning(KeyCode key, Bool down) {
RAWFB_RET_VOID
#if NO_X11
+ if (!key || !down) {}
return;
#else
if ((down ? 1:0) == keycode_state[(int) key]) {
@@ -610,6 +621,7 @@ void XTRAP_FakeKeyEvent_wr(Display* dpy, KeyCode key, Bool down,
RAWFB_RET_VOID
#if NO_X11
nox11_exit(1);
+ if (!dpy || !key || !down || !delay) {}
return;
#else
@@ -642,6 +654,7 @@ void XTestFakeKeyEvent_wr(Display* dpy, KeyCode key, Bool down,
#if NO_X11
nox11_exit(1);
+ if (!dpy || !key || !down || !delay || !first) {}
return;
#else
if (debug_keyboard) {
@@ -699,6 +712,7 @@ void XTRAP_FakeButtonEvent_wr(Display* dpy, unsigned int button, Bool is_press,
RAWFB_RET_VOID
#if NO_X11
nox11_exit(1);
+ if (!dpy || !button || !is_press || !delay) {}
return;
#else
@@ -725,6 +739,7 @@ void XTestFakeButtonEvent_wr(Display* dpy, unsigned int button, Bool is_press,
RAWFB_RET_VOID
#if NO_X11
nox11_exit(1);
+ if (!dpy || !button || !is_press || !delay) {}
return;
#else
@@ -764,6 +779,7 @@ void XTRAP_FakeMotionEvent_wr(Display* dpy, int screen, int x, int y,
#if NO_X11
nox11_exit(1);
+ if (!dpy || !screen || !x || !y || !delay) {}
return;
#else
if (! xtrap_present) {
@@ -788,6 +804,7 @@ void XTestFakeMotionEvent_wr(Display* dpy, int screen, int x, int y,
RAWFB_RET_VOID
#if NO_X11
nox11_exit(1);
+ if (!dpy || !screen || !x || !y || !delay) {}
return;
#else
@@ -825,6 +842,7 @@ Bool XTestCompareCurrentCursorWithWindow_wr(Display* dpy, Window w) {
#if LIBVNCSERVER_HAVE_XTEST
return XTestCompareCurrentCursorWithWindow(dpy, w);
#else
+ if (!w) {}
return False;
#endif
}
@@ -837,6 +855,7 @@ Bool XTestCompareCursorWithWindow_wr(Display* dpy, Window w, Cursor cursor) {
#if LIBVNCSERVER_HAVE_XTEST
return XTestCompareCursorWithWindow(dpy, w, cursor);
#else
+ if (!dpy || !w || !cursor) {}
return False;
#endif
}
@@ -847,6 +866,7 @@ Bool XTestQueryExtension_wr(Display *dpy, int *ev, int *er, int *maj,
#if LIBVNCSERVER_HAVE_XTEST
return XTestQueryExtension(dpy, ev, er, maj, min);
#else
+ if (!dpy || !ev || !er || !maj || !min) {}
return False;
#endif
}
@@ -858,6 +878,8 @@ void XTestDiscard_wr(Display *dpy) {
RAWFB_RET_VOID
#if LIBVNCSERVER_HAVE_XTEST
XTestDiscard(dpy);
+#else
+ if (!dpy) {}
#endif
}
@@ -882,6 +904,7 @@ int XTestGrabControl_wr(Display *dpy, Bool impervious) {
XTestGrabControl(dpy, impervious);
return 1;
#else
+ if (!dpy || !impervious) {}
return 0;
#endif
}
@@ -991,6 +1014,7 @@ Bool XRecordQueryVersion_wr(Display *dpy, int *maj, int *min) {
#if LIBVNCSERVER_HAVE_RECORD
return XRecordQueryVersion(dpy, maj, min);
#else
+ if (!dpy || !maj || !min) {}
return False;
#endif
}
@@ -1045,7 +1069,7 @@ int xauth_raw(int on) {
}
Display *XOpenDisplay_wr(char *display_name) {
- Display *d;
+ Display *d = NULL;
int db = 0;
if (! xauth_raw(1)) {
@@ -1053,6 +1077,7 @@ Display *XOpenDisplay_wr(char *display_name) {
}
#if NO_X11
rfbLog("This x11vnc was built without X11 support (-rawfb only).\n");
+ if (!display_name || !d || !db) {}
return NULL;
#else
@@ -1086,12 +1111,13 @@ static int last_local_y = 0;
Bool XQueryPointer_wr(Display *display, Window w, Window *root_return,
Window *child_return, int *root_x_return, int *root_y_return,
int *win_x_return, int *win_y_return, unsigned int *mask_return) {
- Bool rc;
- XErrorHandler old_handler;
-
#if NO_X11
+ if (!display || !w || !root_return || !child_return || !root_x_return || !root_y_return || !win_x_return || !win_y_return || !mask_return) {}
return False;
#else
+ Bool rc;
+ XErrorHandler old_handler;
+
if (! display) {
return False;
@@ -1137,6 +1163,7 @@ Status XQueryTree_wr(Display *display, Window w, Window *root_return,
}
#endif
#if NO_X11
+ if (!display || !w || !root_return || !parent_return || !children_return || !nchildren_return) {}
return (Status) 0;
#else
if (! display) {
@@ -1164,6 +1191,7 @@ int XFree_wr(void *data) {
int XSelectInput_wr(Display *display, Window w, long event_mask) {
#if NO_X11
+ if (!display || !w || !event_mask) {}
return 0;
#else
int rc;
OpenPOWER on IntegriCloud