Ethereal-dev: Re: [Ethereal-dev] Canary checking added to emem.c

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Gerald Combs <gerald@xxxxxxxxxxxx>
Date: Tue, 10 Jan 2006 15:32:26 -0600
Guy Harris wrote:

> Unfortunately, it also breaks the compile with MSVC++ (it doesn't allow
> adding constants to "void *"s - that's a GCCism; I've checked in a fix),
> and warns about open() and read() - Windows doesn't have "/dev/urandom"
> (and not all UN*Xes have it, either, although all the UN*Xes in the
> buildbot might), so that code won't work in any case.

I changed it to use eth_fopen() and fread().  The canary initialization
now tries the GLib random functions if they exist, then "/dev/urandom",
then random().  It looks for "/dev/urandom" at run time instead of
compile time to account for platforms like Solaris 8, where it may or
may not exist depending on which patches or third-party software you may
have installed.