From 0c0f68e8ff9fb88eaae614d1da316f0037484886 Mon Sep 17 00:00:00 2001 From: Carl Shapiro Date: Fri, 9 Apr 2010 18:23:25 -0700 Subject: [PATCH] Fix a long standing bug in the output buffer size computation. git cherry-pick -e 2a7f2ae7d4b25f89e36be04e47b9e7a3d76e0cfd --- liblog/fake_log_device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/liblog/fake_log_device.c b/liblog/fake_log_device.c index ed9d699ac..f8b725412 100644 --- a/liblog/fake_log_device.c +++ b/liblog/fake_log_device.c @@ -454,7 +454,7 @@ static void showLog(LogState *state, numVecs = numLines*3; // 3 iovecs per line. if (numVecs > INLINE_VECS) { - vec = (struct iovec*)malloc(sizeof(struct iovec)*numLines); + vec = (struct iovec*)malloc(sizeof(struct iovec)*numVecs); if (vec == NULL) { msg = "LOG: write failed, no memory"; numVecs = 3;