source:
scripts/patch/binutils/2.19.1/25-build_id.patch@
7314bbe
Last change on this file since 7314bbe was bb6d7f8, checked in by , 15 years ago | |
---|---|
|
|
File size: 1.3 KB |
-
bfd/elfcode.h
Fix build-id patch to avoid memory corruption. (BZ 501582) diff -rup ../binutils-2.19.51.0.11.orig/bfd/elfcode.h bfd/elfcode.h
old new elf_checksum_contents (bfd *abfd, 1170 1170 1171 1171 if (i_shdr.contents) 1172 1172 (*process) (i_shdr.contents, i_shdr.sh_size, arg); 1173 else 1174 { 1175 asection *sec; 1176 1177 sec = bfd_section_from_elf_index (abfd, count); 1178 if (sec != NULL) 1179 { 1180 if (sec->contents == NULL) 1181 { 1182 /* Force rereading from file. */ 1183 sec->flags &= ~SEC_IN_MEMORY; 1184 if (! bfd_malloc_and_get_section (abfd, sec, & sec->contents)) 1185 continue; 1186 } 1187 if (sec->contents != NULL) 1188 (*process) (sec->contents, i_shdr.sh_size, arg); 1189 } 1190 } 1173 1191 } 1174 1192 1175 1193 return TRUE; -
bfd/section.c
diff -rup ../binutils-2.19.51.0.11.orig/bfd/section.c bfd/section.c
old new bfd_malloc_and_get_section (bfd *abfd, s 1477 1477 if (sz == 0) 1478 1478 return TRUE; 1479 1479 1480 p = bfd_ malloc (sec->rawsize > sec->size ? sec->rawsize : sec->size);1480 p = bfd_zmalloc (sec->rawsize > sec->size ? sec->rawsize : sec->size); 1481 1481 if (p == NULL) 1482 1482 return FALSE; 1483 1483 *buf = p;
Note:
See TracBrowser
for help on using the repository browser.