From 75e8d1f5161eb39a3a05b81044229ba9d2614e94 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Fri, 2 Jun 2000 07:30:28 +0000 Subject: Update. 2000-06-02 Ulrich Drepper * elf/rtld.c (process_envvars): Test for = after variable name. --- elf/rtld.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'elf') diff --git a/elf/rtld.c b/elf/rtld.c index b41a90f..f358700 100644 --- a/elf/rtld.c +++ b/elf/rtld.c @@ -1324,9 +1324,15 @@ process_envvars (enum mode *modep, int *lazyp) while ((envline = _dl_next_ld_env_entry (&runp)) != NULL) { - size_t len = strcspn (envline, "=") - 3; + size_t len = strcspn (envline, "="); - switch (len) + if (envline[len] != '=') + /* This is a "LD_" variable at the end of the string without + a '=' character. Ignore it since otherwise we will access + invalid memory below. */ + break; + + switch (len - 3) { case 4: /* Warning level, verbose or not. */ -- cgit v1.1