mirror of
https://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git
synced 2024-11-27 12:04:43 +08:00
libuuid: fix UBSAN issue in get_random_fd()
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
This commit is contained in:
parent
847520f69e
commit
6074cf36b9
@ -154,7 +154,7 @@ static int get_random_fd(void)
|
||||
fcntl(fd, F_SETFD, i | FD_CLOEXEC);
|
||||
}
|
||||
#endif
|
||||
srand((getpid() << 16) ^ getuid() ^ tv.tv_sec ^ tv.tv_usec);
|
||||
srand(((unsigned)getpid() << 16) ^ getuid() ^ tv.tv_sec ^ tv.tv_usec);
|
||||
#ifdef DO_JRAND_MIX
|
||||
jrand_seed[0] = getpid() ^ (tv.tv_sec & 0xFFFF);
|
||||
jrand_seed[1] = getppid() ^ (tv.tv_usec & 0xFFFF);
|
||||
|
Loading…
Reference in New Issue
Block a user