summaryrefslogtreecommitdiff
path: root/xc/lib/X11
diff options
context:
space:
mode:
authorconverse <empty>1995-05-02 15:07:06 +0000
committerconverse <empty>1995-05-02 15:07:06 +0000
commitbf69aa930224b8f019a2587a64f8f7d2ba784aba (patch)
treeb8ca24e25d039cdc750305981966a64a3ee51ffd /xc/lib/X11
parentbfd44376def5edfbec6e9df804d696fd05533167 (diff)
The asynchronous reply handler for GetAtomName replies,
_XGetAtomNameHandler, must null-terminate the atom name after the name is read from the reply. #7384
Diffstat (limited to 'xc/lib/X11')
-rw-r--r--xc/lib/X11/GetAtomNm.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/xc/lib/X11/GetAtomNm.c b/xc/lib/X11/GetAtomNm.c
index 2f36bd19f..625da0ea8 100644
--- a/xc/lib/X11/GetAtomNm.c
+++ b/xc/lib/X11/GetAtomNm.c
@@ -1,4 +1,4 @@
-/* $XConsortium: GetAtomNm.c,v 11.21 93/11/17 09:36:26 rws Exp $ */
+/* $XConsortium: GetAtomNm.c,v 11.22 94/04/17 20:19:29 rws Exp converse $ */
/*
Copyright (c) 1986 X Consortium
@@ -144,8 +144,13 @@ Bool _XGetAtomNameHandler(dpy, rep, buf, len, data)
_XGetAsyncData(dpy, state->names[state->idx], buf, len,
SIZEOF(xGetAtomNameReply), repl->nameLength,
repl->length << 2);
- _XUpdateAtomCache(dpy, state->names[state->idx],
- state->atoms[state->idx], 0, -1, 0);
+ if (state->names[state->idx]) {
+ state->names[state->idx][repl->nameLength] = '\0';
+ _XUpdateAtomCache(dpy, state->names[state->idx],
+ state->atoms[state->idx], 0, -1, 0);
+ } else {
+ state->status = 0;
+ }
return True;
}