mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Jean-Marc Pigeon <jmp@safe.ca>
To: musl@lists.openwall.com
Subject: setenv if value=NULL, what say standard? Bug?
Date: Wed, 22 Apr 2015 20:08:17 -0400	[thread overview]
Message-ID: <553837F1.5080808@safe.ca> (raw)

[-- Attachment #1: Type: text/plain, Size: 2691 bytes --]

-----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@safe.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-----


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4242 bytes --]

             reply	other threads:[~2015-04-23  0:08 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-23  0:08 Jean-Marc Pigeon [this message]
2015-04-23  0:35 ` Laurent Bercot
2015-04-23  1:26   ` Jean-Marc Pigeon
2015-04-23  2:15     ` Rich Felker
2015-04-23  4:24       ` Jean-Marc Pigeon
2015-04-23  5:08         ` Raphael Cohn
2015-04-23 12:29           ` Jean-Marc Pigeon
2015-04-23  9:23         ` Laurent Bercot
2015-04-23  9:52           ` Raphael Cohn
2015-04-23 10:47             ` Laurent Bercot
2015-04-23 10:10         ` Rich Felker
2015-04-23 12:58           ` Jean-Marc Pigeon
2015-04-23 13:22             ` Szabolcs Nagy
2015-04-23 13:58               ` Jean-Marc Pigeon
2015-04-23 14:26                 ` Szabolcs Nagy
2015-04-23  8:05       ` Jens Gustedt
2015-04-23  9:55         ` Rich Felker
2015-04-24  4:11       ` Isaac Dunham
2015-04-23  5:52   ` Isaac Dunham

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=553837F1.5080808@safe.ca \
    --to=jmp@safe.ca \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).