Commit 0284afb8 authored by Alan Coopersmith's avatar Alan Coopersmith Committed by Ulrich Sibiller

unvalidated length in _XimXGetReadData() [CVE-2013-1997 12/15]

Check the provided buffer size against the amount of data we're going to write into it, not against the reported length from the ClientMessage. Reported-by: 's avatarIlja Van Sprundel <ivansprundel@ioactive.com> Signed-off-by: 's avatarAlan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: 's avatarMatthieu Herrb <matthieu.herrb@laas.fr> Signed-off-by: 's avatarJulien Cristau <jcristau@debian.org> Backported-to-NX-by: 's avatarUlrich Sibiller <uli42@gmx.de>
parent 0bf09b4b
......@@ -372,7 +372,7 @@ _XimXGetReadData(
XFree(prop_ret);
return False;
}
if (buf_len >= length) {
if (buf_len >= (int)nitems) {
(void)memcpy(buf, prop_ret, (int)nitems);
*ret_len = (int)nitems;
if (bytes_after_ret > 0) {
......
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