From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KXYHC-00020H-8r for qemu-devel@nongnu.org; Mon, 25 Aug 2008 05:22:18 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KXYH9-0001zM-9g for qemu-devel@nongnu.org; Mon, 25 Aug 2008 05:22:16 -0400 Received: from [199.232.76.173] (port=32798 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KXYH8-0001yw-6h for qemu-devel@nongnu.org; Mon, 25 Aug 2008 05:22:14 -0400 Received: from il.qumranet.com ([212.179.150.194]:59380) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KXYH7-00060i-T8 for qemu-devel@nongnu.org; Mon, 25 Aug 2008 05:22:14 -0400 Received: from gleb-debian.qumranet.com (gleb-debian.qumranet.com.qumranet.com [172.16.15.143]) by il.qumranet.com (Postfix) with ESMTP id 084C6250310 for ; Mon, 25 Aug 2008 12:22:12 +0300 (IDT) Date: Mon, 25 Aug 2008 12:22:11 +0300 From: Gleb Natapov Message-ID: <20080825092211.GG6192@minantech.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Subject: [Qemu-devel] [PATCH] qemu_strdup() doesn't copy alast character 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 Because of off by one error. Signed-off-by: Gleb Natapov diff --git a/qemu-malloc.c b/qemu-malloc.c index 8ad6168..3bffae1 100644 --- a/qemu-malloc.c +++ b/qemu-malloc.c @@ -60,6 +60,6 @@ char *qemu_strdup(const char *str) ptr = qemu_malloc(len + 1); if (!ptr) return NULL; - pstrcpy(ptr, len, str); + pstrcpy(ptr, len + 1, str); return ptr; } -- Gleb.