Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F102860271
D21531.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D21531.diff
View Options
diff --git a/sys/kern/kern_ctf.c b/sys/kern/kern_ctf.c
--- a/sys/kern/kern_ctf.c
+++ b/sys/kern/kern_ctf.c
@@ -244,7 +244,7 @@
/* Check if decompression is required. */
if (raw != NULL) {
- z_stream zs;
+ uLongf destlen;
int ret;
/*
@@ -253,22 +253,12 @@
*/
bcopy(ctf_hdr, ctftab, sizeof(ctf_hdr));
- /* Initialise the zlib structure. */
- bzero(&zs, sizeof(zs));
-
- if (inflateInit(&zs) != Z_OK) {
- error = EIO;
- goto out;
- }
-
- zs.avail_in = shdr[i].sh_size - sizeof(ctf_hdr);
- zs.next_in = ((uint8_t *) raw) + sizeof(ctf_hdr);
- zs.avail_out = sz - sizeof(ctf_hdr);
- zs.next_out = ((uint8_t *) ctftab) + sizeof(ctf_hdr);
- ret = inflate(&zs, Z_FINISH);
- inflateEnd(&zs);
- if (ret != Z_STREAM_END) {
- printf("%s(%d): zlib inflate returned %d\n", __func__, __LINE__, ret);
+ destlen = sz - sizeof(ctf_hdr);
+ ret = uncompress(((uint8_t *) ctftab) + sizeof(ctf_hdr),
+ &destlen, ((uint8_t *) raw) + sizeof(ctf_hdr),
+ shdr[i].sh_size - sizeof(ctf_hdr));
+ if (ret != Z_OK) {
+ printf("%s(%d): zlib uncompress returned %d\n", __func__, __LINE__, ret);
error = EIO;
goto out;
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Nov 19, 2:49 AM (21 h, 16 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14709061
Default Alt Text
D21531.diff (1 KB)
Attached To
Mode
D21531: Use zlib's uncompress function for simpler code.
Attached
Detach File
Event Timeline
Log In to Comment