Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Leap:42.1:Rings:1-MinimalX
gcab
gcab-checksum.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File gcab-checksum.patch of Package gcab
Index: gcab-0.5/libgcab/cabinet.c =================================================================== --- gcab-0.5.orig/libgcab/cabinet.c +++ gcab-0.5/libgcab/cabinet.c @@ -403,7 +403,12 @@ cdata_write (cdata_t *cd, GDataOutputStr return FALSE; CHECKSUM datacsum = compute_checksum(cd->in, cd->ncbytes, 0); - cd->checksum = compute_checksum ((guint8*)&cd->ncbytes, 4, datacsum); + guint8 tmp[4]; + tmp[0] = cd->ncbytes & 0xff; + tmp[1] = (cd->ncbytes >> 8) & 0xff; + tmp[2] = cd->nubytes & 0xff; + tmp[3] = (cd->nubytes >> 8) & 0xff; + cd->checksum = compute_checksum (tmp, 4, datacsum); GOutputStream *stream = g_filter_output_stream_get_base_stream (G_FILTER_OUTPUT_STREAM (out)); *bytes_written = 0; @@ -462,7 +467,12 @@ cdata_read (cdata_t *cd, u1 res_data, gi RN (buf, cd->ncbytes); datacsum = compute_checksum(buf, cd->ncbytes, 0); - g_return_val_if_fail (cd->checksum == compute_checksum ((guint8*)&cd->ncbytes, 4, datacsum), FALSE); + guint8 tmp[4]; + tmp[0] = cd->ncbytes & 0xff; + tmp[1] = (cd->ncbytes >> 8) & 0xff; + tmp[2] = cd->nubytes & 0xff; + tmp[3] = (cd->nubytes >> 8) & 0xff; + g_return_val_if_fail (cd->checksum == compute_checksum (tmp, 4, datacsum), FALSE); if (g_getenv ("GCAB_DEBUG")) { g_debug ("CDATA");
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