aboutsummaryrefslogtreecommitdiff
path: root/nx-X11
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2017-03-27 16:14:30 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2017-03-27 16:14:30 +0200
commitd7d2aeea4b23f6abb3c51796d18261f11e7bd0ab (patch)
treebbaf11c9165845bce597f8feea55a0501ffd873a /nx-X11
parentac03b5172a00005897705dea0fc125c0309cc59c (diff)
parent00405b278471b4b5aa65003eb7ae97ac17d56445 (diff)
downloadnx-libs-d7d2aeea4b23f6abb3c51796d18261f11e7bd0ab.tar.gz
nx-libs-d7d2aeea4b23f6abb3c51796d18261f11e7bd0ab.tar.bz2
nx-libs-d7d2aeea4b23f6abb3c51796d18261f11e7bd0ab.zip
Merge branch 'uli42-pr/libX11-HEAD' into 3.6.x
Fixes ArcticaProject/nx-libs#400. Attributes GH PR #414: https://github.com/ArcticaProject/nx-libs/pull/414 am into a topic branch.
Diffstat (limited to 'nx-X11')
-rw-r--r--nx-X11/lib/X11/FontNames.c6
-rw-r--r--nx-X11/lib/X11/XlibInt.c10
2 files changed, 14 insertions, 2 deletions
diff --git a/nx-X11/lib/X11/FontNames.c b/nx-X11/lib/X11/FontNames.c
index 3e23b5f49..9ffdfd299 100644
--- a/nx-X11/lib/X11/FontNames.c
+++ b/nx-X11/lib/X11/FontNames.c
@@ -43,6 +43,7 @@ int *actualCount) /* RETURN */
register int length;
char **flist = NULL;
char *ch = NULL;
+ char *chstart;
char *chend;
int count = 0;
xListFontsReply rep;
@@ -86,6 +87,7 @@ int *actualCount) /* RETURN */
/*
* unpack into null terminated strings.
*/
+ chstart = ch;
chend = ch + (rlen + 1);
length = *(unsigned char *)ch;
*ch = 1; /* make sure it is non-zero for XFreeFontNames */
@@ -98,14 +100,14 @@ int *actualCount) /* RETURN */
*ch = '\0'; /* and replace with null-termination */
count++;
} else {
- Xfree(ch);
+ Xfree(chstart);
Xfree(flist);
flist = NULL;
count = 0;
break;
}
} else {
- Xfree(ch);
+ Xfree(chstart);
Xfree(flist);
flist = NULL;
count = 0;
diff --git a/nx-X11/lib/X11/XlibInt.c b/nx-X11/lib/X11/XlibInt.c
index 912c52989..5afc65149 100644
--- a/nx-X11/lib/X11/XlibInt.c
+++ b/nx-X11/lib/X11/XlibInt.c
@@ -3604,6 +3604,16 @@ int _XDefaultError(
XErrorEvent *event)
{
if (_XPrintDefaultError (dpy, event, stderr) == 0) return 0;
+
+ /*
+ * Store in dpy flags that the client is exiting on an unhandled XError
+ * (pretend it is an IOError, since the application is dying anyway it
+ * does not make a difference).
+ * This is useful for _XReply not to hang if the application makes Xlib
+ * calls in _fini as part of process termination.
+ */
+ dpy->flags |= XlibDisplayIOError;
+
exit(1);
/*NOTREACHED*/
}