Blame SOURCES/0002-Always-check-the-return-value-when-writing-to-the-st.patch

7703fd
From 4d2c600f54d2f00d1604aaeb20e2285e9ab0cad9 Mon Sep 17 00:00:00 2001
7703fd
From: Richard Hughes <richard@hughsie.com>
7703fd
Date: Wed, 1 Mar 2017 16:40:05 +0000
7703fd
Subject: [PATCH 2/4] Always check the return value when writing to the stream
7703fd
7703fd
---
7703fd
 libgcab/cabinet.c | 7 ++++---
7703fd
 1 file changed, 4 insertions(+), 3 deletions(-)
7703fd
7703fd
diff --git a/libgcab/cabinet.c b/libgcab/cabinet.c
7703fd
index 4df9024..a675d1b 100644
7703fd
--- a/libgcab/cabinet.c
7703fd
+++ b/libgcab/cabinet.c
7703fd
@@ -190,9 +190,10 @@ cheader_write (cheader_t *ch, GDataOutputStream *out,
7703fd
         return FALSE;
7703fd
 
7703fd
     if (ch->flags & CABINET_HEADER_RESERVE) {
7703fd
-        W2 (ch->res_header);
7703fd
-        W1 (ch->res_folder);
7703fd
-        W1 (ch->res_data);
7703fd
+        if (!W2 (ch->res_header) ||
7703fd
+            !W1 (ch->res_folder) ||
7703fd
+            !W1 (ch->res_data))
7703fd
+                return FALSE;
7703fd
         if (g_output_stream_write (stream, ch->reserved, ch->res_header,
7703fd
                                    cancellable, error) == -1)
7703fd
             return FALSE;
7703fd
-- 
7703fd
2.9.3
7703fd