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