comparison src/libpst.c @ 340:0f3185217313

Daniel Gryniewicz found buffer overrun in LIST_COPY_TIME
author Carl Byington <carl@five-ten-sg.com>
date Fri, 27 Dec 2013 08:27:47 -0800
parents c507af52515a
children c638905665bc
comparison
equal deleted inserted replaced
339:76e8180cdd0c 340:0f3185217313
2066 #define LIST_COPY_TIME(label, targ) { \ 2066 #define LIST_COPY_TIME(label, targ) { \
2067 if (list->elements[x]->type != 0x40) { \ 2067 if (list->elements[x]->type != 0x40) { \
2068 DEBUG_WARN(("src not 0x40 for filetime dst\n")); \ 2068 DEBUG_WARN(("src not 0x40 for filetime dst\n")); \
2069 DEBUG_HEXDUMP(list->elements[x]->data, list->elements[x]->size); \ 2069 DEBUG_HEXDUMP(list->elements[x]->data, list->elements[x]->size); \
2070 } \ 2070 } \
2071 targ = (FILETIME*) pst_realloc(targ, sizeof(FILETIME)); \ 2071 else { \
2072 memcpy(targ, list->elements[x]->data, list->elements[x]->size); \ 2072 targ = (FILETIME*) pst_realloc(targ, sizeof(FILETIME)); \
2073 LE32_CPU(targ->dwLowDateTime); \ 2073 memcpy(targ, list->elements[x]->data, min(sizeof(FILETIME), list->elements[x]->size)); \
2074 LE32_CPU(targ->dwHighDateTime); \ 2074 LE32_CPU(targ->dwLowDateTime); \
2075 DEBUG_INFO((label" - %s", pst_fileTimeToAscii(targ, time_buffer))); \ 2075 LE32_CPU(targ->dwHighDateTime); \
2076 DEBUG_INFO((label" - %s", pst_fileTimeToAscii(targ, time_buffer))); \
2077 } \
2076 } 2078 }
2077 2079
2078 #define LIST_COPY_EMAIL_TIME(label, targ) { \ 2080 #define LIST_COPY_EMAIL_TIME(label, targ) { \
2079 MALLOC_EMAIL(item); \ 2081 MALLOC_EMAIL(item); \
2080 LIST_COPY_TIME(label, targ); \ 2082 LIST_COPY_TIME(label, targ); \