annotate src/timeconv.h @ 359:a3e674fade6c

From Jeffrey Morlan: pst_parse_block misreads Table Contexts (aka "type 2") with a multi-block Row Matrix ("ind2"). Rows are never split between blocks - every block except the last has padding at the end which should be ignored. I've only seen this affect the recipients table, but presumably it could affect attachments too. This was causing out-of-bounds memory ranges to be returned from pst_getBlockOffset and later access; patch fixes both the table reading issue and adds a missing bounds check to pst_getBlockOffset (so as not to risk a segfault if the PST is corrupted).
author Carl Byington <carl@five-ten-sg.com>
date Wed, 06 Jul 2016 10:20:12 -0700
parents e3a46f66332b
children ad7b880ad3d1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
182
b65e8d0a088a more cleanup on external names in the shared object file
Carl Byington <carl@five-ten-sg.com>
parents: 172
diff changeset
1 #ifndef __PST_TIMECONV_H
b65e8d0a088a more cleanup on external names in the shared object file
Carl Byington <carl@five-ten-sg.com>
parents: 172
diff changeset
2 #define __PST_TIMECONV_H
16
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
3
132
5e4d6faada34 fix from Fridrich Strba for parallel make
Carl Byington <carl@five-ten-sg.com>
parents: 120
diff changeset
4 #include "common.h"
5e4d6faada34 fix from Fridrich Strba for parallel make
Carl Byington <carl@five-ten-sg.com>
parents: 120
diff changeset
5
16
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
6 #ifdef __cplusplus
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
7 extern "C" {
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
8 #endif
199
e3a46f66332b more changes in recurrence decoding
Carl Byington <carl@five-ten-sg.com>
parents: 182
diff changeset
9 /** Convert a FILETIME to ascii printable local time.
e3a46f66332b more changes in recurrence decoding
Carl Byington <carl@five-ten-sg.com>
parents: 182
diff changeset
10 @param[in] filetime time structure to be converted
e3a46f66332b more changes in recurrence decoding
Carl Byington <carl@five-ten-sg.com>
parents: 182
diff changeset
11 @param[out] result pointer to output buffer, must be at least 30 bytes.
e3a46f66332b more changes in recurrence decoding
Carl Byington <carl@five-ten-sg.com>
parents: 182
diff changeset
12 @return result pointer to the output buffer
e3a46f66332b more changes in recurrence decoding
Carl Byington <carl@five-ten-sg.com>
parents: 182
diff changeset
13 */
e3a46f66332b more changes in recurrence decoding
Carl Byington <carl@five-ten-sg.com>
parents: 182
diff changeset
14 char* pst_fileTimeToAscii (const FILETIME* filetime, char* result);
e3a46f66332b more changes in recurrence decoding
Carl Byington <carl@five-ten-sg.com>
parents: 182
diff changeset
15
e3a46f66332b more changes in recurrence decoding
Carl Byington <carl@five-ten-sg.com>
parents: 182
diff changeset
16 /** Convert a FILETIME to unix struct tm.
e3a46f66332b more changes in recurrence decoding
Carl Byington <carl@five-ten-sg.com>
parents: 182
diff changeset
17 @param[in] filetime time structure to be converted
e3a46f66332b more changes in recurrence decoding
Carl Byington <carl@five-ten-sg.com>
parents: 182
diff changeset
18 @param[out] result pointer to output struct tm
e3a46f66332b more changes in recurrence decoding
Carl Byington <carl@five-ten-sg.com>
parents: 182
diff changeset
19 */
e3a46f66332b more changes in recurrence decoding
Carl Byington <carl@five-ten-sg.com>
parents: 182
diff changeset
20 void pst_fileTimeToStructTM (const FILETIME* filetime, struct tm *result);
e3a46f66332b more changes in recurrence decoding
Carl Byington <carl@five-ten-sg.com>
parents: 182
diff changeset
21
e3a46f66332b more changes in recurrence decoding
Carl Byington <carl@five-ten-sg.com>
parents: 182
diff changeset
22 /** Convert a FILETIME to unix time_t value.
e3a46f66332b more changes in recurrence decoding
Carl Byington <carl@five-ten-sg.com>
parents: 182
diff changeset
23 @param[in] filetime time structure to be converted
e3a46f66332b more changes in recurrence decoding
Carl Byington <carl@five-ten-sg.com>
parents: 182
diff changeset
24 @return result time_t value
e3a46f66332b more changes in recurrence decoding
Carl Byington <carl@five-ten-sg.com>
parents: 182
diff changeset
25 */
e3a46f66332b more changes in recurrence decoding
Carl Byington <carl@five-ten-sg.com>
parents: 182
diff changeset
26 time_t pst_fileTimeToUnixTime( const FILETIME* filetime);
16
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
27 #ifdef __cplusplus
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
28 }
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
29 #endif
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
30
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
31 #endif