mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-11 20:35:50 +00:00
Bug 186201: should handle a null 'environ' pointer, which can happen on
Solaris if NSS is loaded with dlopen() by an executable linked with the RTLD_GROUP flag.
This commit is contained in:
parent
ec08fd394a
commit
22b938bb47
@ -827,12 +827,14 @@ for the small amount of entropy it provides.
|
||||
* execution environment of the user and on the platform the program
|
||||
* is running on.
|
||||
*/
|
||||
cp = (const char * const *)environ;
|
||||
while (*cp) {
|
||||
RNG_RandomUpdate(*cp, strlen(*cp));
|
||||
cp++;
|
||||
if (environ != NULL) {
|
||||
cp = environ;
|
||||
while (*cp) {
|
||||
RNG_RandomUpdate(*cp, strlen(*cp));
|
||||
cp++;
|
||||
}
|
||||
RNG_RandomUpdate(environ, (char*)cp - (char*)environ);
|
||||
}
|
||||
RNG_RandomUpdate(environ, (char*)cp - (char*)environ);
|
||||
|
||||
/* Give in system information */
|
||||
if (gethostname(buf, sizeof(buf)) > 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user