Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <553837F1.5080808@safe.ca>
Date: Wed, 22 Apr 2015 20:08:17 -0400
From: Jean-Marc Pigeon <jmp@...e.ca>
To: musl@...ts.openwall.com
Subject: setenv if value=NULL, what say standard? Bug?

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello,


hwclock (util-linux-2.26) is crashing, this is caused by
setenv.

#0  mktime_tz (tm=..., universal=1, valid_p=0x7fffffffea4c,
systime_p=0x7fffffffea30) at sys-utils/hwclock.c:411
#1  0x00000000004025f6 in read_hardware_clock (universal=1,
valid_p=0x7fffffffea4c, systime_p=0x7fffffffea30)
    at sys-utils/hwclock.c:476
#2  0x0000000000403bae in manipulate_clock (show=1, adjust=0,
noadjfile=0, set=0, set_time=0, hctosys=0,
    systohc=0, systz=0, startup_time=..., utc=0, local_opt=0,
update=0, testing=0, predict=0, get=0)
    at sys-utils/hwclock.c:1336
#3  0x0000000000404b37 in main (argc=0, argv=0x7fffffffebe8) at
sys-utils/hwclock.c:1965

src:
hwclock.c:411 setenv("TZ", getenv("TZUTC"), TRUE);

as TZUTC is undefined (NULL),
setenv is crashing

setenv.c:30 l2 = strlen(value);

fixing the hwclock code is a possibility,
but we could have other same-kind situation
far less obvious in other application, making
all sort of code to crash "randomly".

Tried to see what was saying standard,
about  (const char *value) to be NULL
when calling
setenv(const char *name, const char *value, int overwrite);
found nothing.

My guess, glibc code is 'blindly" setting the NULL (as "")
value to the variable.

Is the standard saying otherwise, or do we have a
a real bug in setenv??




- -- 

A bientôt
===========================================================
Jean-Marc Pigeon                        E-Mail: jmp@...e.ca
SAFE Inc.                             Phone: (514) 493-4280
  Clement, 'a kiss solution' to get rid of SPAM (at last)
     Clement' Home base <"http://www.clement.safe.ca">
===========================================================
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBAgAGBQJVODfxAAoJEAtgwJ4bBQU5Aj4QAIvcx2qmpFwJEYfF4CzL2c/M
mAYTToDCGmyQcsLg0ZNTn/jfIFDuJ4wlY5piNgY/uFOg+3MwddEs1QhZhjZt9jeW
50cDffYYF18EMBuCC6D7gF1kIsMUmGUavvJbQCq3fTfhhIHTQoScDm9fM8EcU0jl
wywmos8XYgGRgIxOGKCkqmqG6luAjvZQcjsubG+CPb5aGRJndljCwZAIL1fXwjiL
QBjD1Ww2KTXlUM0bduIbYKPTVO/cTM3y+RqiN5BtQG7G1ipMBbDiyHlY5RqV3mZ7
07vcXwwC5G+DLOtGe7ZXQLIt7SgGR24rsXMT0O+kyRqkCXJ0KJBf78ezC05hQwvr
H+V7kSaDHMcfBc85cCf5I1iOdST+2dx5S7VZ+O7/0DPudCda6DcezWgVCxr6zfbw
Ow1GH/QjcmLGf73lXez1ccSKNeP5FOJxgFoKKDaO5iYxG7iEig2LKLEvK4uMATLv
VZfPOIdL7RmEe0Nt+aXe3X07DrJkPxbEq6nVzG8kJE2Jm1YAipcsDYcmrngaM3Hf
9tZ/RXqCNquOjitUTQrBesn0nIGa83woPo/FwGPWdH3nuQWjtvOMZ9z1sNmy3AXx
85eQxZDWGyYQ0VP/iQAttvWLV8L+nY46tJs2curFMsHwcucHHprRke4VTQxy+FD6
f3wAVbTKx3VlNwcsgJ7y
=lWjh
-----END PGP SIGNATURE-----


Download attachment "smime.p7s" of type "application/pkcs7-signature" (4242 bytes)

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.