2008-05-06 11:35:24

by Matthias Koenig

[permalink] [raw]
Subject: [PATCH] libuuid: don't use unitialized variable

Hi,

tv is not initialized before the assigment to last.

Signed-Off-By: Matthias Koenig <[email protected]>

Index: e2fsprogs-1.40.8/lib/uuid/gen_uuid.c
===================================================================
--- e2fsprogs-1.40.8.orig/lib/uuid/gen_uuid.c
+++ e2fsprogs-1.40.8/lib/uuid/gen_uuid.c
@@ -316,7 +316,7 @@ static int get_clock(uint32_t *clock_hig
if ((last.tv_sec == 0) && (last.tv_usec == 0)) {
get_random_bytes(&clock_seq, sizeof(clock_seq));
clock_seq &= 0x3FFF;
- last = tv;
+ gettimeofday(&last, 0);
last.tv_sec--;
}





2008-05-12 03:22:27

by Theodore Ts'o

[permalink] [raw]
Subject: Re: [PATCH] libuuid: don't use unitialized variable

On Tue, May 06, 2008 at 01:38:31PM +0200, Matthias Koenig wrote:
> Hi,
>
> tv is not initialized before the assigment to last.
>
> Signed-Off-By: Matthias Koenig <[email protected]>

Thanks, applied.

- Ted