Index: src/common/mac/macho_id.cc |
diff --git a/src/common/mac/macho_id.cc b/src/common/mac/macho_id.cc |
index 09a2a82e1799145f5429df199bfd4a7a514ad113..5579c1edad63ec524be351890031dc938066e40b 100644 |
--- a/src/common/mac/macho_id.cc |
+++ b/src/common/mac/macho_id.cc |
@@ -36,7 +36,6 @@ |
extern "C" { // necessary for Leopard |
Mark Mentovai
2015/09/11 15:49:50
1. This was probably never true.
2. Nobody cares a
Ted Mielczarek
2015/09/15 12:58:36
Done.
|
#include <fcntl.h> |
#include <mach-o/loader.h> |
- #include <mach-o/swap.h> |
#include <stdio.h> |
#include <stdlib.h> |
#include <string.h> |
@@ -61,7 +60,7 @@ MachoID::MachoID(const char *path) |
crc_(0), |
md5_context_(), |
update_function_(NULL) { |
- strlcpy(path_, path, sizeof(path_)); |
+ strncpy(path_, path, sizeof(path_) - 1); |
} |
MachoID::MachoID(const char *path, void *memory, size_t size) |
@@ -70,7 +69,7 @@ MachoID::MachoID(const char *path, void *memory, size_t size) |
crc_(0), |
md5_context_(), |
update_function_(NULL) { |
- strlcpy(path_, path, sizeof(path_)); |
+ strncpy(path_, path, sizeof(path_) - 1); |
} |
MachoID::~MachoID() { |
@@ -261,7 +260,7 @@ bool MachoID::WalkerCB(MachoWalker *walker, load_command *cmd, off_t offset, |
return false; |
if (swap) |
- swap_segment_command(&seg, NXHostByteOrder()); |
+ breakpad_swap_segment_command(&seg); |
struct mach_header_64 header; |
off_t header_offset; |
@@ -278,7 +277,7 @@ bool MachoID::WalkerCB(MachoWalker *walker, load_command *cmd, off_t offset, |
return false; |
if (swap) |
- swap_section(&sec, 1, NXHostByteOrder()); |
+ breakpad_swap_section(&sec, 1); |
// sections of type S_ZEROFILL are "virtual" and contain no data |
// in the file itself |
@@ -294,7 +293,7 @@ bool MachoID::WalkerCB(MachoWalker *walker, load_command *cmd, off_t offset, |
return false; |
if (swap) |
- breakpad_swap_segment_command_64(&seg64, NXHostByteOrder()); |
+ breakpad_swap_segment_command_64(&seg64); |
struct mach_header_64 header; |
off_t header_offset; |
@@ -311,7 +310,7 @@ bool MachoID::WalkerCB(MachoWalker *walker, load_command *cmd, off_t offset, |
return false; |
if (swap) |
- breakpad_swap_section_64(&sec64, 1, NXHostByteOrder()); |
+ breakpad_swap_section_64(&sec64, 1); |
// sections of type S_ZEROFILL are "virtual" and contain no data |
// in the file itself |
@@ -340,7 +339,7 @@ bool MachoID::UUIDWalkerCB(MachoWalker *walker, load_command *cmd, off_t offset, |
return false; |
if (swap) |
- breakpad_swap_uuid_command(uuid_cmd, NXHostByteOrder()); |
+ breakpad_swap_uuid_command(uuid_cmd); |
return false; |
} |
@@ -359,7 +358,7 @@ bool MachoID::IDWalkerCB(MachoWalker *walker, load_command *cmd, off_t offset, |
return false; |
if (swap) |
- swap_dylib_command(dylib_cmd, NXHostByteOrder()); |
+ breakpad_swap_dylib_command(dylib_cmd); |
return false; |
} |