NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

kern/44335: cmdbuf too short in m41st84.c.



>Number:         44335
>Category:       kern
>Synopsis:       cmdbuf too short in m41st84.c.
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Jan 07 10:35:00 +0000 2011
>Originator:     Henning Petersen
>Release:        NetBSD-current
>Organization:
>Environment:
>Description:
cmdbuf too short in m41st84.c .
>How-To-Repeat:

>Fix:
diff -u -r1.16 m41st84.c
--- sys/dev/i2c/m41st84.c       10 Oct 2010 05:17:44 -0000      1.16
+++ sys/dev/i2c/m41st84.c       7 Jan 2011 08:12:28 -0000
@@ -272,7 +272,7 @@
 static int
 strtc_clock_read(struct strtc_softc *sc, struct clock_ymdhms *dt)
 {
-       u_int8_t bcd[M41ST84_REG_DATE_BYTES], cmdbuf[1];
+       u_int8_t bcd[M41ST84_REG_DATE_BYTES], cmdbuf[2];
        int i;
 
        if (iic_acquire_bus(sc->sc_tag, I2C_F_POLL)) {



Home | Main Index | Thread Index | Old Index