[PATCH] Startup crash without LOGNAME or HOME environment vars

Sander M. Kleijwegt Sander at MyOwnDomain.nl
Wed Aug 19 08:53:03 PDT 2015


Dear All,

Subsurface would crash on my Ubuntu 14.04 using my own build of the current
head of master (72806e42bc23ab7c7f2a639a1efee017388b53bc, aug 18). The
culprit was that I had no LOGNAME variable in my environment. Running
subsurface as "LOGNAME='whatever' ./subsurface" was a quick workaround.

Please find attached a trivial patch that checks if there are NULL pointers
returned by getenv, and if so defaults to "~" and/or "default" for the HOME
and LOGNAME variables.

kind regards,
Sander Kleijwegt

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20150819/52c1db1f/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: startup_crash_with_empty_env.patch
Type: text/x-patch
Size: 444 bytes
Desc: not available
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20150819/52c1db1f/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 6210 bytes
Desc: not available
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20150819/52c1db1f/attachment-0003.bin>


More information about the subsurface mailing list