From patchwork Mon Mar 29 17:54:42 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 49415 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id A4F0DB7CF8 for ; Tue, 6 Apr 2010 04:04:12 +1000 (EST) Received: from localhost ([127.0.0.1]:39535 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nyqef-0005sS-QD for incoming@patchwork.ozlabs.org; Mon, 05 Apr 2010 14:04:09 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NyqEr-0003G1-A2 for qemu-devel@nongnu.org; Mon, 05 Apr 2010 13:37:29 -0400 Received: from [140.186.70.92] (port=47520 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NyqEo-0003E4-1L for qemu-devel@nongnu.org; Mon, 05 Apr 2010 13:37:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NyqEl-0001Ci-CD for qemu-devel@nongnu.org; Mon, 05 Apr 2010 13:37:25 -0400 Received: from are.twiddle.net ([75.149.56.221]:60868) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NyqEl-0001CL-5d for qemu-devel@nongnu.org; Mon, 05 Apr 2010 13:37:23 -0400 Received: by are.twiddle.net (Postfix, from userid 5000) id 9B2D0DD3; Mon, 5 Apr 2010 10:37:21 -0700 (PDT) Message-Id: <259b99693dc30d50fec822d4b3356c7082ad0c12.1270488612.git.rth@twiddle.net> In-Reply-To: References: From: Richard Henderson Date: Mon, 29 Mar 2010 10:54:42 -0700 To: qemu-devel@nongnu.org X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) Cc: blauwirbel@gmail.com Subject: [Qemu-devel] [PATCH 6/7] Fix zero-length write(2). X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: Richard Henderson --- exec.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/exec.c b/exec.c index 33854e1..d69194c 100644 --- a/exec.c +++ b/exec.c @@ -2461,6 +2461,9 @@ int page_check_range(target_ulong start, target_ulong len, int flags) assert(start < ((abi_ulong)1 << L1_MAP_ADDR_SPACE_BITS)); #endif + if (len == 0) { + return 0; + } if (start + len - 1 < start) { /* We've wrapped around. */ return -1;