Bug 3166 - getenv(HOME) null pointer dereference
getenv(HOME) null pointer dereference
Product: Samba 3.0
Classification: Unclassified
Component: libsmbclient
All All
: P3 normal
: none
Assigned To: Derrell Lipman
Samba QA Contact
Depends on:
  Show dependency treegraph
Reported: 2005-10-13 08:31 UTC by Derrell Lipman
Modified: 2005-10-13 11:08 UTC (History)
0 users

See Also:

Patch I've applied to 3.0 (2.18 KB, patch)
2005-10-13 11:08 UTC, Jeremy Allison
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Derrell Lipman 2005-10-13 08:31:14 UTC
smbc_init_context() issues

  home = getenv("HOME")
  slprintf(conf, sizeof(conf), "%s/.smb/smb.conf", home)

but if HOME is not set in the environment, 'home' is null.

Fix to assume that if HOME is not set, then ${HOME}/.smb/smb.conf and
${HOME}/.smb/smb.conf.append do not exist.
Comment 1 Jeremy Allison 2005-10-13 11:08:14 UTC
Created attachment 1507 [details]
Patch I've applied to 3.0
Comment 2 Jeremy Allison 2005-10-13 11:08:28 UTC
Fixed in SVN. Thanks.