diff options
author | Jeremy Huddleston <jeremyhu@apple.com> | 2011-10-09 02:26:45 -0700 |
---|---|---|
committer | Jeremy Huddleston <jeremyhu@apple.com> | 2011-10-09 02:27:59 -0700 |
commit | 913603660c17ec59a4d39d3e3b9d60469ee5c060 (patch) | |
tree | 9a44f4675e8f93aadaf1437da3f1d2d908581c20 | |
parent | 566ceaf5a92c721ac7155528e4d0d2e5cbef023f (diff) | |
download | xorg-lib-libX11-913603660c17ec59a4d39d3e3b9d60469ee5c060.tar.gz |
Fix potential uninitialized variable access in _XimMakeICAttrIDList
Found by clang static analysis
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
-rw-r--r-- | modules/im/ximcp/imRmAttr.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/modules/im/ximcp/imRmAttr.c b/modules/im/ximcp/imRmAttr.c index 2e732658..c047715f 100644 --- a/modules/im/ximcp/imRmAttr.c +++ b/modules/im/ximcp/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) { |