]> granicus.if.org Git - file/commitdiff
mention the bug here, and fix a debugging printf.
authorChristos Zoulas <christos@zoulas.com>
Wed, 20 Apr 2016 00:00:26 +0000 (00:00 +0000)
committerChristos Zoulas <christos@zoulas.com>
Wed, 20 Apr 2016 00:00:26 +0000 (00:00 +0000)
src/compress.c

index 2a95f85df8321536df352f5711521a5e8837fe20..a3808996e98277bc8283aac9e150567c497f76c0 100644 (file)
@@ -35,7 +35,7 @@
 #include "file.h"
 
 #ifndef lint
-FILE_RCSID("@(#)$File: compress.c,v 1.94 2016/04/19 13:39:19 christos Exp $")
+FILE_RCSID("@(#)$File: compress.c,v 1.95 2016/04/19 23:36:36 christos Exp $")
 #endif
 
 #include "magic.h"
@@ -215,7 +215,7 @@ file_zmagic(struct magic_set *ms, int fd, const char *name,
                        continue;
                nsz = nbytes;
                urv = uncompressbuf(fd, ms->bytes_max, i, buf, &newbuf, &nsz);
-               DPRINTF("uncompressbuf = %d, %s, %zu\n", rv, (char *)newbuf,
+               DPRINTF("uncompressbuf = %d, %s, %zu\n", urv, (char *)newbuf,
                    nsz);
                switch (urv) {
                case OKDATA:
@@ -239,6 +239,10 @@ file_zmagic(struct magic_set *ms, int fd, const char *name,
                                goto error;
                        if ((pb = file_push_buffer(ms)) == NULL)
                                goto error;
+                       /*
+                        * XXX: If file_buffer fails here, we overwrite
+                        * the compressed text. FIXME.
+                        */
                        if (file_buffer(ms, -1, NULL, buf, nbytes) == -1)
                                goto error;
                        if ((rbuf = file_pop_buffer(ms, pb)) != NULL) {