NetBSD-Bugs archive

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

kern/46373: Correct use of sizeof in dmover_io.c



>Number:         46373
>Category:       kern
>Synopsis:       Correct use of sizeof in dmover_io.c
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Apr 25 08:10:00 +0000 2012
>Originator:     Henning Petersen
>Release:        NetBSD-current
>Organization:
>Environment:
>Description:
Correct use of sizeof in dmover_io.c .
>How-To-Repeat:

>Fix:
diff -u -p -r1.40 dmover_io.c
--- sys/dev/dmover/dmover_io.c  14 May 2011 13:52:00 -0000      1.40
+++ sys/dev/dmover/dmover_io.c  22 Apr 2012 09:09:06 -0000
@@ -595,7 +595,7 @@ dmio_stat(struct file *fp, struct stat *
 {
        struct dmio_state *ds = fp->f_data;
 
-       (void)memset(st, 0, sizeof(st));
+       (void)memset(st, 0, sizeof(*st));
        KERNEL_LOCK(1, NULL);
        st->st_dev = makedev(cdevsw_lookup_major(&dmoverio_cdevsw), 0);
        st->st_atimespec = ds->ds_atime;



Home | Main Index | Thread Index | Old Index