]> sbz's 6dev Repos - ctfdump/.git/commitdiff
Skip the header in the non compressed case too.
authorMartin Pieuchot <mpi@openbsd.org>
Wed, 16 Mar 2016 18:36:27 +0000 (19:36 +0100)
committerMartin Pieuchot <mpi@openbsd.org>
Wed, 16 Mar 2016 18:36:27 +0000 (19:36 +0100)
ctfdump.c

index ef632dd0af9b2db72fc3e2cb5afc4f4ee15e80b4..bfbfc5cd703e4cbfbc6a14d8f38c0816c8eeb18c 100644 (file)
--- a/ctfdump.c
+++ b/ctfdump.c
@@ -397,13 +397,15 @@ int
 ctf_dump(const char *p, size_t size, uint8_t flags)
 {
        struct ctf_header       *cth = (struct ctf_header *)p;
 ctf_dump(const char *p, size_t size, uint8_t flags)
 {
        struct ctf_header       *cth = (struct ctf_header *)p;
-       char                    *data = (char *)p;
        off_t                    dlen = cth->cth_stroff + cth->cth_strlen;
        off_t                    dlen = cth->cth_stroff + cth->cth_strlen;
+       char                    *data;
 
        if (cth->cth_flags & CTF_F_COMPRESS) {
                data = decompress(p + sizeof(*cth), size - sizeof(*cth), dlen);
                if (data == NULL)
                        return 1;
 
        if (cth->cth_flags & CTF_F_COMPRESS) {
                data = decompress(p + sizeof(*cth), size - sizeof(*cth), dlen);
                if (data == NULL)
                        return 1;
+       } else {
+               data = (char *)p + sizeof(*cth);
        }
 
        if (flags & DUMP_HEADER) {
        }
 
        if (flags & DUMP_HEADER) {