From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JtInT-0002CA-Ma for qemu-devel@nongnu.org; Tue, 06 May 2008 04:45:16 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JtInS-0002AW-17 for qemu-devel@nongnu.org; Tue, 06 May 2008 04:45:14 -0400 Received: from [199.232.76.173] (port=57055 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JtInR-0002AN-Nn for qemu-devel@nongnu.org; Tue, 06 May 2008 04:45:13 -0400 Received: from savannah.gnu.org ([199.232.41.3] 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 1JtInR-0002fd-Ls for qemu-devel@nongnu.org; Tue, 06 May 2008 04:45:13 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1JtInQ-0006JY-E9 for qemu-devel@nongnu.org; Tue, 06 May 2008 08:45:12 +0000 Received: from edgar_igl by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1JtInP-0006JR-JG for qemu-devel@nongnu.org; Tue, 06 May 2008 08:45:12 +0000 MIME-Version: 1.0 Errors-To: edgar_igl Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: "Edgar E. Iglesias" Message-Id: Date: Tue, 06 May 2008 08:45:11 +0000 Subject: [Qemu-devel] [4353] Teach the CRIS disassembler to stay within the provided buffer. 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: 4353 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=4353 Author: edgar_igl Date: 2008-05-06 08:45:10 +0000 (Tue, 06 May 2008) Log Message: ----------- Teach the CRIS disassembler to stay within the provided buffer. Modified Paths: -------------- trunk/cris-dis.c Modified: trunk/cris-dis.c =================================================================== --- trunk/cris-dis.c 2008-05-06 08:44:21 UTC (rev 4352) +++ trunk/cris-dis.c 2008-05-06 08:45:10 UTC (rev 4353) @@ -2625,12 +2625,10 @@ If we can't get any data, or we do not get enough data, we print the error message. */ - for (nbytes = MAX_BYTES_PER_CRIS_INSN; nbytes > 0; nbytes -= 2) - { - status = (*info->read_memory_func) (memaddr, buffer, nbytes, info); - if (status == 0) - break; - } + nbytes = info->buffer_length; + if (nbytes > MAX_BYTES_PER_CRIS_INSN) + nbytes = MAX_BYTES_PER_CRIS_INSN; + status = (*info->read_memory_func) (memaddr, buffer, nbytes, info); /* If we did not get all we asked for, then clear the rest. Hopefully this makes a reproducible result in case of errors. */