Blame SOURCES/libgxps-0.3.0-archive-handle-error.patch
|
|
f549cc |
From 133fe2a96e020d4ca65c6f64fb28a404050ebbfd Mon Sep 17 00:00:00 2001
|
|
|
f549cc |
From: Carlos Garcia Campos <carlosgc@gnome.org>
|
|
|
f549cc |
Date: Sat, 5 May 2018 12:02:36 +0200
|
|
|
f549cc |
Subject: [PATCH 2/2] gxps-archive: Handle errors returned by archive_read_data
|
|
|
f549cc |
|
|
|
f549cc |
---
|
|
|
f549cc |
libgxps/gxps-archive.c | 7 +++++++
|
|
|
f549cc |
1 file changed, 7 insertions(+)
|
|
|
f549cc |
|
|
|
f549cc |
diff --git a/libgxps/gxps-archive.c b/libgxps/gxps-archive.c
|
|
|
f549cc |
index 346ba73..1bae729 100644
|
|
|
f549cc |
--- a/libgxps/gxps-archive.c
|
|
|
f549cc |
+++ b/libgxps/gxps-archive.c
|
|
|
f549cc |
@@ -520,6 +520,13 @@ gxps_archive_input_stream_read (GInputStream *stream,
|
|
|
f549cc |
return -1;
|
|
|
f549cc |
|
|
|
f549cc |
bytes_read = archive_read_data (istream->zip->archive, buffer, count);
|
|
|
f549cc |
+ if (bytes_read < 0) {
|
|
|
f549cc |
+ g_set_error_literal (error,
|
|
|
f549cc |
+ G_IO_ERROR,
|
|
|
f549cc |
+ g_io_error_from_errno (archive_errno (istream->zip->archive)),
|
|
|
f549cc |
+ archive_error_string (istream->zip->archive));
|
|
|
f549cc |
+ return -1;
|
|
|
f549cc |
+ }
|
|
|
f549cc |
if (bytes_read == 0 && istream->is_interleaved && !gxps_archive_input_stream_is_last_piece (istream)) {
|
|
|
f549cc |
/* Read next piece */
|
|
|
f549cc |
gxps_archive_input_stream_next_piece (istream);
|
|
|
f549cc |
--
|
|
|
f549cc |
2.17.1
|
|
|
f549cc |
|