Unverified Commit d7d2aeea authored by Mike Gabriel's avatar Mike Gabriel

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.
parents ac03b517 00405b27
...@@ -43,6 +43,7 @@ int *actualCount) /* RETURN */ ...@@ -43,6 +43,7 @@ int *actualCount) /* RETURN */
register int length; register int length;
char **flist = NULL; char **flist = NULL;
char *ch = NULL; char *ch = NULL;
char *chstart;
char *chend; char *chend;
int count = 0; int count = 0;
xListFontsReply rep; xListFontsReply rep;
...@@ -86,6 +87,7 @@ int *actualCount) /* RETURN */ ...@@ -86,6 +87,7 @@ int *actualCount) /* RETURN */
/* /*
* unpack into null terminated strings. * unpack into null terminated strings.
*/ */
chstart = ch;
chend = ch + (rlen + 1); chend = ch + (rlen + 1);
length = *(unsigned char *)ch; length = *(unsigned char *)ch;
*ch = 1; /* make sure it is non-zero for XFreeFontNames */ *ch = 1; /* make sure it is non-zero for XFreeFontNames */
...@@ -98,14 +100,14 @@ int *actualCount) /* RETURN */ ...@@ -98,14 +100,14 @@ int *actualCount) /* RETURN */
*ch = '\0'; /* and replace with null-termination */ *ch = '\0'; /* and replace with null-termination */
count++; count++;
} else { } else {
Xfree(ch); Xfree(chstart);
Xfree(flist); Xfree(flist);
flist = NULL; flist = NULL;
count = 0; count = 0;
break; break;
} }
} else { } else {
Xfree(ch); Xfree(chstart);
Xfree(flist); Xfree(flist);
flist = NULL; flist = NULL;
count = 0; count = 0;
......
...@@ -3604,6 +3604,16 @@ int _XDefaultError( ...@@ -3604,6 +3604,16 @@ int _XDefaultError(
XErrorEvent *event) XErrorEvent *event)
{ {
if (_XPrintDefaultError (dpy, event, stderr) == 0) return 0; 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); exit(1);
/*NOTREACHED*/ /*NOTREACHED*/
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment