Commits
Ken Cunningham authored and Mojca Miklavec committed a8423424fed
1 + | --- darwinxref/plugins/register.c.orig 2013-10-16 16:25:16.000000000 -0700 |
2 + | +++ darwinxref/plugins/register.c 2017-05-21 10:34:04.000000000 -0700 |
3 + | |
4 + | // sections immediately follow the dylib_command structure, and are |
5 + | // reflected in the cmdsize. |
6 + | |
7 + | - int strsize = dylib->cmdsize - sizeof(struct dylib_command); |
8 + | + unsigned long int strsize = dylib->cmdsize - sizeof(struct dylib_command); |
9 + | char* str = malloc(strsize+1); |
10 + | strncpy(str, (char*)((uint8_t*)dylib + dylib->dylib.name.offset), strsize); |
11 + | str[strsize] = 0; // NUL-terminate |
12 + | |
13 + | // sections immediately follow the dylib_command structure, and are |
14 + | // reflected in the cmdsize. |
15 + | |
16 + | - int strsize = dylinker->cmdsize - sizeof(struct dylinker_command); |
17 + | + unsigned long int strsize = dylinker->cmdsize - sizeof(struct dylinker_command); |
18 + | char* str = malloc(strsize+1); |
19 + | strncpy(str, (char*)((uint8_t*)dylinker + dylinker->name.offset), strsize); |
20 + | str[strsize] = 0; // NUL-terminate |
21 + | |
22 + | if (swap) swap_symtab_command(symtab, NXHostByteOrder()); |
23 + | |
24 + | nsyms = symtab->nsyms; |
25 + | - uint32_t symsize = nsyms * (mh64 ? sizeof(struct nlist_64) : sizeof(struct nlist)); |
26 + | + unsigned long int symsize = nsyms * (mh64 ? sizeof(struct nlist_64) : sizeof(struct nlist)); |
27 + | symbols = malloc(symsize); |
28 + | |
29 + | strsize = symtab->strsize; |