This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/1973] getenv returns pointer to unallocated space.
- From: "marvin dot nospam at gmail dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sources dot redhat dot com
- Date: 21 Jan 2006 17:45:11 -0000
- Subject: [Bug libc/1973] getenv returns pointer to unallocated space.
- References: <20051203125947.1973.marvin.nospam@gmail.com>
- Reply-to: sourceware-bugzilla at sourceware dot org
------- Additional Comments From marvin dot nospam at gmail dot com 2006-01-21 17:45 -------
I received more e-mails from people reporting this segmentation fault in my
program. I know what you are thinking ("it is a bug in your program"), but just
look at the code:
---------------------------------
void
read_plugins (KTPluginList *plugin_list)
/*
Input:
-
Output:
plugin_list - The plugins are added to this list.
Returns:
-
Description:
This function reads the plugins from the plugin directories and adds them to
plugin_list.
*/
{
char *home_dir,
*local_plugin_dir;
int local_plugin_dir_len;
read_plugin_dir (PLUGIN_DIR, plugin_list);
home_dir = (char *)getenv("HOME");
if (home_dir != NULL)
{
local_plugin_dir_len = strlen(home_dir)+strlen("/"LOCAL_PLUGIN_DIR);
local_plugin_dir = keytouch_malloc(local_plugin_dir_len+1);
strcpy (local_plugin_dir, home_dir);
strcat (local_plugin_dir, "/"LOCAL_PLUGIN_DIR);
read_plugin_dir (local_plugin_dir, plugin_list);
free (local_plugin_dir);
}
}
---------------------------------
I only received reports from people using an AMD64.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |REOPENED
Resolution|WORKSFORME |
http://sourceware.org/bugzilla/show_bug.cgi?id=1973
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.