From 4e519f5a802aabb894dd790881bded9c11ef9c6c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tim=20R=C3=BChsen?= <tim.ruehsen@gmx.de>
Date: Fri, 21 Feb 2020 14:37:40 +0100
Subject: [PATCH] * src/warc.c (warc_write_end_record): Check return value of
 fseeko (Coverity #1419657)

---
 src/warc.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/warc.c b/src/warc.c
index 9c8a5c75..e22f1fce 100644
--- a/src/warc.c
+++ b/src/warc.c
@@ -357,8 +357,13 @@ warc_write_end_record (void)
       compressed_size = warc_current_gzfile_uncompressed_size;
 
       /* Go back to the static GZIP header. */
-      fseeko (warc_current_file, warc_current_gzfile_offset
+      result = fseeko (warc_current_file, warc_current_gzfile_offset
               + EXTRA_GZIP_HEADER_SIZE, SEEK_SET);
+      if (result != 0)
+        {
+          warc_write_ok = false;
+          return false;
+        }
 
       /* Read the header. */
       result = fread (static_header, 1, GZIP_STATIC_HEADER_SIZE,