On 2 February 2013 22:28:10 "Anthony G. Basile" <[email protected]> wrote:
Hi everyone,

While working on getting mkostemp and friends into musl, I looked
closely at the uclibc code.  In libc/misc/internals/tempname.c, in
brain_damaged_fillrand() we have

        ....
         static uint64_t value;
        gettimeofday(&tv, NULL);
        value += ((uint64_t) tv.tv_usec << 16) ^ tv.tv_sec ^ getpid();
        ...

Even though 'value' is declared static it is never initialized.  Isn't
this a problem?  I know we want random values in value, but this is
probably undefined behavior and who knows what the compiler will do with it.

This is C.


Sent with AquaMail for Android
http://www.aqua-mail.com


_______________________________________________
uClibc mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/uclibc

Reply via email to