From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LErys-0007WT-5y for qemu-devel@nongnu.org; Mon, 22 Dec 2008 16:06:26 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LEryr-0007W4-Gq for qemu-devel@nongnu.org; Mon, 22 Dec 2008 16:06:25 -0500 Received: from [199.232.76.173] (port=59784 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LEryr-0007Vy-Be for qemu-devel@nongnu.org; Mon, 22 Dec 2008 16:06:25 -0500 Received: from savannah.gnu.org ([199.232.41.3]:46183 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LEryq-0005e5-B6 for qemu-devel@nongnu.org; Mon, 22 Dec 2008 16:06:24 -0500 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1LEryp-0002yT-OX for qemu-devel@nongnu.org; Mon, 22 Dec 2008 21:06:23 +0000 Received: from aliguori by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1LEryp-0002yP-HO for qemu-devel@nongnu.org; Mon, 22 Dec 2008 21:06:23 +0000 MIME-Version: 1.0 Errors-To: aliguori Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Anthony Liguori Message-Id: Date: Mon, 22 Dec 2008 21:06:23 +0000 Subject: [Qemu-devel] [6121] Properly handle the case of SetPixelEncodings with a length of zero. Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Revision: 6121 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6121 Author: aliguori Date: 2008-12-22 21:06:23 +0000 (Mon, 22 Dec 2008) Log Message: ----------- Properly handle the case of SetPixelEncodings with a length of zero. This commit addresses CORE-2008-1210/CVE-2008-2382. Signed-off-by: Anthony Liguori Modified Paths: -------------- trunk/vnc.c Modified: trunk/vnc.c =================================================================== --- trunk/vnc.c 2008-12-22 20:33:55 UTC (rev 6120) +++ trunk/vnc.c 2008-12-22 21:06:23 UTC (rev 6121) @@ -1503,10 +1503,13 @@ if (len == 1) return 4; - if (len == 4) - return 4 + (read_u16(data, 2) * 4); + if (len == 4) { + limit = read_u16(data, 2); + if (limit > 0) + return 4 + (limit * 4); + } else + limit = read_u16(data, 2); - limit = read_u16(data, 2); for (i = 0; i < limit; i++) { int32_t val = read_s32(data, 4 + (i * 4)); memcpy(data + 4 + (i * 4), &val, sizeof(val));