Skip to content

Commit

Permalink
This could become a bug if the error message contained formatting
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Anton Staaf committed Mar 26, 2010
1 parent 65c7ceb commit 964e325
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions disktest/src/disktest.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 964e325

Please sign in to comment.