This could become a bug if the error message contained formatting
characters that would cause fprintf to try and read varargs that aren't
there.

Signed-off-by: Anton Staaf <[email protected]>
From e59d7b2bf0c36dcb538391c6b7ee6270247c2ca2 Mon Sep 17 00:00:00 2001
From: robotboy <[email protected]>
Date: Tue, 23 Mar 2010 13:23:39 -0700
Subject: [PATCH] Don't treat the error message as a format string in die().

This could become a bug if the error message contained formatting
characters that would cause fprintf to try and read varargs that
aren't there.

Signed-off-by: Anton Staaf <[email protected]>

Review URL: http://codereview.chromium.org/1196001
---
 client/tests/disktest/src/disktest.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/client/tests/disktest/src/disktest.c b/client/tests/disktest/src/disktest.c
index b07feb2..c7659e9 100644
--- a/client/tests/disktest/src/disktest.c
+++ b/client/tests/disktest/src/disktest.c
@@ -43,8 +43,7 @@ unsigned int stop_on_error = 0;
 
 void die(char *error)
 {
-	fprintf(stderr, error);
-	fprintf(stderr, "\n");
+	fprintf(stderr, "%s\n", error);
 	exit(1);
 }
 
-- 
1.7.0.1

_______________________________________________
Autotest mailing list
[email protected]
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest

Reply via email to