Source-Changes-HG archive

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

[src/trunk]: src/sys/compat/netbsd32 Fix uninitialized pointer bug.



details:   https://anonhg.NetBSD.org/src/rev/170dfa5aa18a
branches:  trunk
changeset: 500101:170dfa5aa18a
user:      eeh <eeh%NetBSD.org@localhost>
date:      Tue Dec 05 15:25:57 2000 +0000

description:
Fix uninitialized pointer bug.

diffstat:

 sys/compat/netbsd32/netbsd32_ioctl.c |  16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diffs (60 lines):

diff -r 27f198b39505 -r 170dfa5aa18a sys/compat/netbsd32/netbsd32_ioctl.c
--- a/sys/compat/netbsd32/netbsd32_ioctl.c      Tue Dec 05 15:20:10 2000 +0000
+++ b/sys/compat/netbsd32/netbsd32_ioctl.c      Tue Dec 05 15:25:57 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: netbsd32_ioctl.c,v 1.7 2000/08/19 14:38:18 eeh Exp $   */
+/*     $NetBSD: netbsd32_ioctl.c,v 1.8 2000/12/05 15:25:57 eeh Exp $   */
 
 /*
  * Copyright (c) 1998 Matthew R. Green
@@ -521,7 +521,7 @@
                 */
                memset(data32, 0, size32);
        else if (com&IOC_VOID)
-               *(caddr_t *)data = (caddr_t)(u_long)SCARG(uap, data);
+               *(caddr_t *)data32 = (caddr_t)(u_long)SCARG(uap, data);
 
 /* we define some handy macros here... */
 #define IOCTL_STRUCT_CONV_TO(cmd, type)        \
@@ -544,7 +544,7 @@
         */
        switch (SCARG(uap, com)) {
        case FIONBIO:
-               if ((tmp = *(int *)data) != 0)
+               if ((tmp = *(int *)data32) != 0)
                        fp->f_flag |= FNONBLOCK;
                else
                        fp->f_flag &= ~FNONBLOCK;
@@ -552,7 +552,7 @@
                break;
 
        case FIOASYNC:
-               if ((tmp = *(int *)data) != 0)
+               if ((tmp = *(int *)data32) != 0)
                        fp->f_flag |= FASYNC;
                else
                        fp->f_flag &= ~FASYNC;
@@ -560,7 +560,7 @@
                break;
 
        case FIOSETOWN:
-               tmp = *(int *)data;
+               tmp = *(int *)data32;
                if (fp->f_type == DTYPE_SOCKET) {
                        ((struct socket *)fp->f_data)->so_pgid = tmp;
                        error = 0;
@@ -583,11 +583,11 @@
        case FIOGETOWN:
                if (fp->f_type == DTYPE_SOCKET) {
                        error = 0;
-                       *(int *)data = ((struct socket *)fp->f_data)->so_pgid;
+                       *(int *)data32 = ((struct socket *)fp->f_data)->so_pgid;
                        break;
                }
-               error = (*fp->f_ops->fo_ioctl)(fp, TIOCGPGRP, data, p);
-               *(int *)data = -*(int *)data;
+               error = (*fp->f_ops->fo_ioctl)(fp, TIOCGPGRP, data32, p);
+               *(int *)data32 = -*(int *)data32;
                break;
 
 /*



Home | Main Index | Thread Index | Old Index