Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
No build reason found for SLE-Module-Public-Cloud:ppc64le
SUSE:SLE-12-SP1:GA
libgxps.9080
libgxps-CVE-2018-10733.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File libgxps-CVE-2018-10733.patch of Package libgxps.9080
diff --git a/libgxps/gxps-archive.c b/libgxps/gxps-archive.c index b63efe2..fcdead4 100644 --- a/libgxps/gxps-archive.c +++ b/libgxps/gxps-archive.c @@ -358,9 +358,16 @@ gxps_archive_read_entry (GXPSArchive *archive, gboolean retval; stream = gxps_archive_open (archive, path); + if (!stream) - /* TODO: Error */ + { + g_set_error(error, + G_IO_ERROR, + G_IO_ERROR_NOT_FOUND, + "The entry '%s' was not found in archive", + path); return FALSE; + } entry_size = archive_entry_size (GXPS_ARCHIVE_INPUT_STREAM (stream)->entry); if (entry_size <= 0) { @@ -375,7 +382,7 @@ gxps_archive_read_entry (GXPSArchive *archive, *buffer = g_malloc (buffer_size); do { bytes = g_input_stream_read (stream, &buf, BUFFER_SIZE, NULL, error); - if (*error != NULL) { + if (bytes < 0) { g_free (*buffer); g_object_unref (stream); @@ -390,8 +397,14 @@ gxps_archive_read_entry (GXPSArchive *archive, *bytes_read += bytes; } while (bytes > 0); - if (*bytes_read == 0) { - /* TODO: Error */ + if (*bytes_read == 0) + { + g_set_error(error, + G_IO_ERROR, + G_IO_ERROR_INVALID_DATA, + "The entry '%s' is empty in archive", + path); + g_free (*buffer); g_object_unref (stream); return FALSE; @@ -421,10 +434,22 @@ gxps_archive_input_stream_read (GInputStream *stream, GError **error) { GXPSArchiveInputStream *istream = GXPS_ARCHIVE_INPUT_STREAM (stream); + gssize bytes_read; if (g_cancellable_set_error_if_cancelled (cancellable, error)) return -1; - return archive_read_data (istream->zip->archive, buffer, count); + + bytes_read = archive_read_data (istream->zip->archive, buffer, count); + if (bytes_read < 0) + { + g_set_error_literal (error, + G_IO_ERROR, + g_io_error_from_errno (archive_errno (istream->zip->archive)), + archive_error_string (istream->zip->archive)); + return -1; + } + + return bytes_read; } static gssize diff --git a/libgxps/gxps-fonts.c b/libgxps/gxps-fonts.c index 882157d..843f860 100644 --- a/libgxps/gxps-fonts.c +++ b/libgxps/gxps-fonts.c @@ -220,20 +220,15 @@ gxps_fonts_new_font_face (GXPSArchive *zip, cairo_font_face_t *font_face; guchar *font_data; gsize font_data_len; - gboolean res; - res = gxps_archive_read_entry (zip, font_uri, - &font_data, &font_data_len, - error); - if (!res) { - g_set_error (error, - GXPS_ERROR, - GXPS_ERROR_SOURCE_NOT_FOUND, - "Font source %s not found in archive", - font_uri); + if(!gxps_archive_read_entry(zip, + font_uri, + &font_data, &font_data_len, + error)) { return NULL; } + ft_face.font_data = font_data; ft_face.font_data_len = (gssize)font_data_len; diff --git a/libgxps/gxps-images.c b/libgxps/gxps-images.c index 28e26b2..7b03d63 100644 --- a/libgxps/gxps-images.c +++ b/libgxps/gxps-images.c @@ -469,18 +469,15 @@ gxps_images_create_from_tiff (GXPSArchive *zip, guchar *data; guchar *p; - if (!gxps_archive_read_entry (zip, image_uri, - &buffer.buffer, - &buffer.buffer_len, - error)) { - g_set_error (error, - GXPS_ERROR, - GXPS_ERROR_SOURCE_NOT_FOUND, - "Image source %s not found in archive", - image_uri); + if (!gxps_archive_read_entry(zip, + image_uri, + &buffer.buffer, + &buffer.buffer_len, + error)) { return NULL; } + buffer.pos = 0; _tiff_push_handlers ();
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor