Francois Gouget : testbot/testagentd: Fix the buffer reallocation in vset_status().
Alexandre Julliard
julliard at winehq.org
Fri Nov 30 13:03:00 CST 2012
Module: tools
Branch: master
Commit: 6587169d46cd96d75919b6578ca5e71cb07087a0
URL: http://source.winehq.org/git/tools.git/?a=commit;h=6587169d46cd96d75919b6578ca5e71cb07087a0
Author: Francois Gouget <fgouget at codeweavers.com>
Date: Fri Nov 30 12:15:04 2012 +0100
testbot/testagentd: Fix the buffer reallocation in vset_status().
---
testbot/src/testagentd/testagentd.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/testbot/src/testagentd/testagentd.c b/testbot/src/testagentd/testagentd.c
index 4d5a13e..4973fd5 100644
--- a/testbot/src/testagentd/testagentd.c
+++ b/testbot/src/testagentd/testagentd.c
@@ -190,12 +190,15 @@ static void vset_status(const char* format, va_list valist)
{
int len;
va_list args;
- len = 1;
+ len = 0;
do
{
if (len >= status_size)
{
- status_size = (len +0xf) & ~0xf;
+ /* len does not count the trailing '\0'. So add 1 and round up
+ * to the next 16 bytes multiple.
+ */
+ status_size = (len + 1 + 0xf) & ~0xf;
status = realloc(status, status_size);
}
va_copy(args, valist);
More information about the wine-cvs
mailing list