qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH] qemu_strdup() doesn't copy alast character


From: Gleb Natapov
Subject: [Qemu-devel] [PATCH] qemu_strdup() doesn't copy alast character
Date: Mon, 25 Aug 2008 12:22:11 +0300

Because of off by one error.


Signed-off-by: Gleb Natapov <address@hidden>

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.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]