Skip to content

Commit 97f5044

Browse files
committed
Address feedback from code review
1 parent 8c89b60 commit 97f5044

1 file changed

Lines changed: 24 additions & 22 deletions

File tree

libclamav/ole2_extract.c

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,30 @@ typedef struct property_tag {
152152
unsigned char reserved[4];
153153
} property_t;
154154

155+
156+
/*
157+
* File Information Block Base.
158+
* Naming is consistent with
159+
* https://learn.microsoft.com/en-us/openspecs/office_file_formats/ms-doc/26fb6c06-4e5c-4778-ab4e-edbf26a545bb
160+
* */
161+
typedef struct __attribute__((packed)) fib_base_type {
162+
uint16_t wIdent;
163+
uint16_t nFib;
164+
uint16_t unused;
165+
uint16_t lid;
166+
uint16_t pnNext;
167+
uint16_t ABCDEFGHIJKLM;
168+
uint16_t nFibBack;
169+
uint32_t lKey;
170+
uint8_t envr;
171+
uint8_t NOPQRS;
172+
uint16_t reserved3;
173+
uint16_t reserved4;
174+
uint32_t reserved5;
175+
uint32_t reserved6;
176+
} fib_base_t;
177+
178+
155179
struct ole2_list_node;
156180

157181
typedef struct ole2_list_node {
@@ -616,28 +640,6 @@ static int ole2_cmp_name(const char *const name, uint32_t name_size, const char
616640
return strcasecmp(decoded, keyword);
617641
}
618642

619-
/*
620-
* File Information Block Base.
621-
* Naming is consistent with
622-
* https://learn.microsoft.com/en-us/openspecs/office_file_formats/ms-doc/26fb6c06-4e5c-4778-ab4e-edbf26a545bb
623-
* */
624-
typedef struct fib_base_type {
625-
uint16_t wIdent __attribute__((packed));
626-
uint16_t nFib;
627-
uint16_t unused;
628-
uint16_t lid;
629-
uint16_t pnNext;
630-
uint16_t ABCDEFGHIJKLM;
631-
uint16_t nFibBack;
632-
uint32_t lKey;
633-
uint8_t envr;
634-
uint8_t NOPQRS;
635-
uint16_t reserved3;
636-
uint16_t reserved4;
637-
uint32_t reserved5;
638-
uint32_t reserved6;
639-
} fib_base_t;
640-
641643
static void copy_fib_base(fib_base_t *pFib, const uint8_t *const ptr)
642644
{
643645
memcpy(pFib, ptr, sizeof(fib_base_t));

0 commit comments

Comments
 (0)