From 042e206d131c921b5bff3764b8e9dad14521c011 Mon Sep 17 00:00:00 2001 From: Giacomo Tesio Date: Mon, 16 Jan 2017 02:00:10 +0100 Subject: [PATCH] kernel: devrtc: fix use of uninitialized array in rtcextract CID 156229: Uninitialized scalar variable (UNINIT)9. uninit_use: Using uninitialized value bcdclock[0]. --- sys/src/kern/386/devrtc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/src/kern/386/devrtc.c b/sys/src/kern/386/devrtc.c index 1008c49..a41964c 100644 --- a/sys/src/kern/386/devrtc.c +++ b/sys/src/kern/386/devrtc.c @@ -118,6 +118,9 @@ rtcextract(void) break; } + if(i == 10000) + return -1; + /* * convert from BCD */