summaryrefslogtreecommitdiff
path: root/src/southbridge/dmp
diff options
context:
space:
mode:
authorDaniele Forsi <dforsi@gmail.com>2014-07-26 11:17:03 +0200
committerEdward O'Callaghan <eocallaghan@alterapraxis.com>2014-07-28 23:10:13 +0200
commitc2519e5a06ba5f70bfcb1e2e70ade440c9552f18 (patch)
treebb98bed32595bb071f3e2ab645791909390c130a /src/southbridge/dmp
parentf8e96f07d40152a3b11a70ddbd909e9da8fabf7e (diff)
downloadcoreboot-c2519e5a06ba5f70bfcb1e2e70ade440c9552f18.tar.xz
dmp/vortex86ex/southbridge.c: Do not access arrays out of bound
Found by Cppcheck 1.65. Fixes: [src/southbridge/dmp/vortex86ex/southbridge.c:498]: (error) Array 'rtc[7]' accessed at index 7, which is out of bounds. [src/southbridge/dmp/vortex86ex/southbridge.c:498]: (error) Array 'bin_rtc[7]' accessed at index 7, which is out of bounds. Change-Id: I8939fe1b326202bbe2784639b0e591f8ee470eeb Signed-off-by: Daniele Forsi <dforsi@gmail.com> Reviewed-on: http://review.coreboot.org/6375 Tested-by: build bot (Jenkins) Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com> Reviewed-by: Andrew Wu <arw@dmp.com.tw>
Diffstat (limited to 'src/southbridge/dmp')
-rw-r--r--src/southbridge/dmp/vortex86ex/southbridge.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/southbridge/dmp/vortex86ex/southbridge.c b/src/southbridge/dmp/vortex86ex/southbridge.c
index b9432f0260..a2b1246c71 100644
--- a/src/southbridge/dmp/vortex86ex/southbridge.c
+++ b/src/southbridge/dmp/vortex86ex/southbridge.c
@@ -494,7 +494,7 @@ static void fix_cmos_rtc_time(void)
/* Convert RTC from BCD format to binary. */
u8 bin_rtc[7];
int i;
- for (i = 0; i < 8; i++) {
+ for (i = 0; i < 7; i++) {
bin_rtc[i] = bcd2dec(rtc[i]);
}