about summary refs log tree commit diff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-06-02 07:30:28 +0000
committerUlrich Drepper <drepper@redhat.com>2000-06-02 07:30:28 +0000
commit75e8d1f5161eb39a3a05b81044229ba9d2614e94 (patch)
treea2ca378ecf1221351cb0b37aa5c44615d9c94b81
parent6c021fdc2f9defa902ae6e74a8ee44c402acf421 (diff)
downloadglibc-75e8d1f5161eb39a3a05b81044229ba9d2614e94.tar.gz
glibc-75e8d1f5161eb39a3a05b81044229ba9d2614e94.tar.xz
glibc-75e8d1f5161eb39a3a05b81044229ba9d2614e94.zip
Update.
2000-06-02  Ulrich Drepper  <drepper@redhat.com>

	* elf/rtld.c (process_envvars): Test for = after variable name.
-rw-r--r--ChangeLog4
-rw-r--r--elf/rtld.c10
2 files changed, 12 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 4100b0ceba..de4529d796 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2000-06-02  Ulrich Drepper  <drepper@redhat.com>
+
+	* elf/rtld.c (process_envvars): Test for = after variable name.
+
 2000-06-01  Ulrich Drepper  <drepper@redhat.com>
 
 	* sysdeps/generic/initfini.c (_init): One less relocation.  Don't
diff --git a/elf/rtld.c b/elf/rtld.c
index b41a90f3ec..f358700466 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.  */