diff options
author | Jeremy Huddleston <jeremyhu@apple.com> | 2011-10-09 02:26:45 -0700 |
---|---|---|
committer | Ulrich Sibiller <uli42@gmx.de> | 2016-10-19 21:40:25 +0200 |
commit | 73a2898af337ea96772dfd1036d7c36e61ac5fd0 (patch) | |
tree | c7f0293b51e31084b183ef79e76372dfc42b74b7 /nx-X11 | |
parent | bec22fe978b41f36e7d9f47480f1fd24d5a23973 (diff) | |
download | nx-libs-73a2898af337ea96772dfd1036d7c36e61ac5fd0.tar.gz nx-libs-73a2898af337ea96772dfd1036d7c36e61ac5fd0.tar.bz2 nx-libs-73a2898af337ea96772dfd1036d7c36e61ac5fd0.zip |
Fix potential uninitialized variable access in _XimMakeICAttrIDList
Found by clang static analysis
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Backported-to-NX-by: Ulrich Sibiller <uli42@gmx.de>
Diffstat (limited to 'nx-X11')
-rw-r--r-- | nx-X11/lib/X11/imRmAttr.c | 7 |
1 files changed, 5 insertions, 2 deletions
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) { |