Blame SOURCES/0209-lib-problem-report-API-check-fseek-return-code.patch

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