From a7d83c252e978dfdd42de5bdc01e292167501b51 Mon Sep 17 00:00:00 2001
From: Matej Habrnal <mhabrnal@redhat.com>
Date: Fri, 22 Jan 2016 13:17:13 +0100
Subject: [PATCH] lib: problem report API check fseek return code
Related to #1261358
Signed-off-by: Matej Habrnal <mhabrnal@redhat.com>
---
src/lib/problem_report.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/lib/problem_report.c b/src/lib/problem_report.c
index 6598c15..2bf5530 100644
--- a/src/lib/problem_report.c
+++ b/src/lib/problem_report.c
@@ -344,7 +344,8 @@ format_percented_string(const char *str, problem_data_t *pd, FILE *result)
opt_depth--;
if (!okay[opt_depth])
{
- fseek(result, old_pos[opt_depth], SEEK_SET);
+ if (fseek(result, old_pos[opt_depth], SEEK_SET) < 0)
+ perror_msg_and_die("fseek");
len = old_pos[opt_depth];
}
str += 2;
--
1.8.3.1