From 73a2898af337ea96772dfd1036d7c36e61ac5fd0 Mon Sep 17 00:00:00 2001 From: Jeremy Huddleston Date: Sun, 9 Oct 2011 02:26:45 -0700 Subject: Fix potential uninitialized variable access in _XimMakeICAttrIDList Found by clang static analysis Signed-off-by: Jeremy Huddleston Backported-to-NX-by: Ulrich Sibiller --- nx-X11/lib/X11/imRmAttr.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'nx-X11') diff --git a/nx-X11/lib/X11/imRmAttr.c b/nx-X11/lib/X11/imRmAttr.c index 56a55a13f..52f860553 100644 --- a/nx-X11/lib/X11/imRmAttr.c +++ b/nx-X11/lib/X11/imRmAttr.c @@ -177,6 +177,8 @@ _XimMakeICAttrIDList( else *len += new_len; return name; } + *len += new_len; + buf = (CARD16 *)((char *)buf + new_len); } else if (res->xrm_name == sts_quark) { if ((name = _XimMakeICAttrIDList(ic, res_list, res_num, (XIMArg *)p->value, buf, &new_len, @@ -185,9 +187,10 @@ _XimMakeICAttrIDList( else *len += new_len; return name; } + *len += new_len; + buf = (CARD16 *)((char *)buf + new_len); } - *len += new_len; - buf = (CARD16 *)((char *)buf + new_len); + if (!(res = _XimGetNestedListSeparator(res_list, res_num))) { p++; if (p) { -- cgit v1.2.3