From 8ab0b9cabacad57cad7c26144baa544fab9c2ba7 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Sat, 13 Oct 2012 19:46:53 +0200 Subject: [PATCH] trasher: check seek return value. Fixes CID733726 Signed-off-by: Michael Niedermayer --- tools/trasher.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/trasher.c b/tools/trasher.c index 93bfc0c3e4..aaa09f4ca8 100644 --- a/tools/trasher.c +++ b/tools/trasher.c @@ -56,7 +56,10 @@ int main(int argc, char **argv) while (count--) { int burst = 1 + ran() * (uint64_t) (abs(maxburst) - 1) / UINT32_MAX; int pos = ran() * (uint64_t) length / UINT32_MAX; - fseek(f, pos, SEEK_SET); + if (fseek(f, pos, SEEK_SET) < 0) { + fprintf(stderr, "seek failed\n"); + return 1; + } if (maxburst < 0) burst = -maxburst;