openbsd-ports/graphics/xfig/patches/patch-u_error_c
2022-03-11 19:22:04 +00:00

15 lines
614 B
Plaintext

Avoids null deref->segfault->core seen if you exit by closing the window.
--- src/u_error.c.orig Thu May 5 00:05:10 2016
+++ src/u_error.c Thu Dec 22 12:22:20 2016
@@ -65,6 +65,9 @@ int X_error_handler(Display *d, XErrorEvent *err_ev)
/* uninstall error handlers so we don't recurse if another error happens! */
XSetErrorHandler(NULL);
XSetIOErrorHandler((XIOErrorHandler) NULL);
+ if (!err_ev) {
+ return 0;
+ }
XGetErrorText(tool_d, (int) (err_ev->error_code), err_msg, MAXERRMSGLEN - 1);
(void) fprintf(stderr,
"xfig%s: X error trapped - error message follows:\n%s\n",