comparison src/libpst.c @ 345:a8577226f7a9

fixes from AJ Shankar for attachment processing and body encodings that contain embedded null chars
author Carl Byington <carl@five-ten-sg.com>
date Mon, 09 Mar 2015 10:47:58 -0700
parents 5d0dc4db45b3
children 09dd5299d91c
comparison
equal deleted inserted replaced
344:aedcf979f439 345:a8577226f7a9
1302 1302
1303 if ((id2_ptr = pst_getID2(id2_head, (uint64_t)0x671))) { 1303 if ((id2_ptr = pst_getID2(id2_head, (uint64_t)0x671))) {
1304 DEBUG_INFO(("ATTACHMENT processing attachment\n")); 1304 DEBUG_INFO(("ATTACHMENT processing attachment\n"));
1305 list = pst_parse_block(pf, id2_ptr->id->i_id, id2_head); 1305 list = pst_parse_block(pf, id2_ptr->id->i_id, id2_head);
1306 if (!list) { 1306 if (!list) {
1307 DEBUG_WARN(("ERROR error processing main attachment record\n")); 1307 if (item->flags & PST_FLAG_HAS_ATTACHMENT) {
1308 // Only report an error if we expected to see an attachment table and didn't.
1309 DEBUG_WARN(("ERROR error processing main attachment record\n"));
1310 }
1308 if (!m_head) pst_free_id2(id2_head); 1311 if (!m_head) pst_free_id2(id2_head);
1309 DEBUG_RET(); 1312 DEBUG_RET();
1310 return item; 1313 return item;
1311 } 1314 }
1312 for (x=0; x < list->count_objects; x++) { 1315 for (x=0; x < list->count_objects; x++) {
1349 DEBUG_WARN(("ERROR pst_process() failed with an attachment\n")); 1352 DEBUG_WARN(("ERROR pst_process() failed with an attachment\n"));
1350 pst_free_list(list); 1353 pst_free_list(list);
1351 continue; 1354 continue;
1352 } 1355 }
1353 pst_free_list(list); 1356 pst_free_list(list);
1354 id2_ptr = pst_getID2(id2_head, attach->id2_val); 1357 // As per 2.4.6.2 in the spec, the attachment data is stored as a child of the
1358 // attachment object, so we pass in id2_ptr as the head to search from.
1359 id2_ptr = pst_getID2(id2_ptr, attach->id2_val);
1355 if (id2_ptr) { 1360 if (id2_ptr) {
1356 DEBUG_WARN(("second pass attachment updating id2 %#"PRIx64" found i_id %#"PRIx64"\n", attach->id2_val, id2_ptr->id->i_id)); 1361 DEBUG_WARN(("second pass attachment updating id2 %#"PRIx64" found i_id %#"PRIx64"\n", attach->id2_val, id2_ptr->id->i_id));
1357 // i_id has been updated to the datablock containing the attachment data 1362 // i_id has been updated to the datablock containing the attachment data
1358 attach->i_id = id2_ptr->id->i_id; 1363 attach->i_id = id2_ptr->id->i_id;
1359 attach->id2_head = deep_copy(id2_ptr->child); 1364 attach->id2_head = deep_copy(id2_ptr->child);