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