Skip to content

Commit

Permalink
Address feedback from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
ragusaa committed Jun 27, 2024
1 parent 8c89b60 commit 97f5044
Showing 1 changed file with 24 additions and 22 deletions.
46 changes: 24 additions & 22 deletions libclamav/ole2_extract.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,30 @@ typedef struct property_tag {
unsigned char reserved[4];
} property_t;


/*
* File Information Block Base.
* Naming is consistent with
* https://learn.microsoft.com/en-us/openspecs/office_file_formats/ms-doc/26fb6c06-4e5c-4778-ab4e-edbf26a545bb
* */
typedef struct __attribute__((packed)) fib_base_type {
uint16_t wIdent;
uint16_t nFib;
uint16_t unused;
uint16_t lid;
uint16_t pnNext;
uint16_t ABCDEFGHIJKLM;
uint16_t nFibBack;
uint32_t lKey;
uint8_t envr;
uint8_t NOPQRS;
uint16_t reserved3;
uint16_t reserved4;
uint32_t reserved5;
uint32_t reserved6;
} fib_base_t;


struct ole2_list_node;

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

/*
* File Information Block Base.
* Naming is consistent with
* https://learn.microsoft.com/en-us/openspecs/office_file_formats/ms-doc/26fb6c06-4e5c-4778-ab4e-edbf26a545bb
* */
typedef struct fib_base_type {
uint16_t wIdent __attribute__((packed));
uint16_t nFib;
uint16_t unused;
uint16_t lid;
uint16_t pnNext;
uint16_t ABCDEFGHIJKLM;
uint16_t nFibBack;
uint32_t lKey;
uint8_t envr;
uint8_t NOPQRS;
uint16_t reserved3;
uint16_t reserved4;
uint32_t reserved5;
uint32_t reserved6;
} fib_base_t;

static void copy_fib_base(fib_base_t *pFib, const uint8_t *const ptr)
{
memcpy(pFib, ptr, sizeof(fib_base_t));
Expand Down

0 comments on commit 97f5044

Please sign in to comment.