Browse Source

Frank Mehnert writes:
in ldso/ldso.c, function _dl_get_ready_to_run, the variable app_tpnt_tmp
is not initialized. The function _dl_parse_dynamic_info() initializes
some of their members but not all. For example, if the binary does _not_
contain a DT_TEXTREL record, it is possible that the condition
if (app_tpnt->dynamic_info[DT_TEXTREL])
is nevertheless true and we therefore enter the following code path
(ldso.c:270).

My suggestion is to add
_dl_memset(&app_tpnt_rel, 0, sizeof(app_tpnt_rel));
just behind the variable declarations of _dl_get_ready_to_run().

Mike Frysinger 19 years ago
parent
commit
e96b985e27
1 changed files with 1 additions and 0 deletions
  1. 1 0
      ldso/ldso/ldso.c

+ 1 - 0
ldso/ldso/ldso.c

@@ -139,6 +139,7 @@ void _dl_get_ready_to_run(struct elf_resolve *tpnt, unsigned long load_addr,
 	 * setup so we can use _dl_dprintf() to print debug noise
 	 * setup so we can use _dl_dprintf() to print debug noise
 	 * instead of the SEND_STDERR macros used in dl-startup.c */
 	 * instead of the SEND_STDERR macros used in dl-startup.c */
 
 
+	_dl_memset(&app_tpnt_rel, 0x00, sizeof(app_tpnt_rel));
 
 
 	/* Store the page size for later use */
 	/* Store the page size for later use */
 	_dl_pagesize = (auxvt[AT_PAGESZ].a_un.a_val) ? (size_t) auxvt[AT_PAGESZ].a_un.a_val : PAGE_SIZE;
 	_dl_pagesize = (auxvt[AT_PAGESZ].a_un.a_val) ? (size_t) auxvt[AT_PAGESZ].a_un.a_val : PAGE_SIZE;