From: Ulrich Drepper Date: Thu, 17 Jun 1999 10:41:12 +0000 (+0000) Subject: (_dl_init_paths): Add one more element to aelem to not write beyond allocated X-Git-Tag: cvs/glibc_2-1-2~391 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=45dea6bc6fde484d8c1b4c8161f338fb9bacbe39;p=thirdparty%2Fglibc.git (_dl_init_paths): Add one more element to aelem to not write beyond allocated memory. --- diff --git a/elf/dl-load.c b/elf/dl-load.c index 5ed5128ef57..a0448e9091d 100644 --- a/elf/dl-load.c +++ b/elf/dl-load.c @@ -513,7 +513,7 @@ _dl_init_paths (const char *llp) /* First set up the rest of the default search directory entries. */ aelem = rtld_search_dirs = (struct r_search_path_elem **) - malloc ((sizeof (system_dirs_len) / sizeof (system_dirs_len[0])) + malloc ((sizeof (system_dirs_len) / sizeof (system_dirs_len[0]) + 1) * sizeof (struct r_search_path_elem *)); if (rtld_search_dirs == NULL) _dl_signal_error (ENOMEM, NULL, "cannot create search path array");