Source-Changes-HG archive

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

[src/netbsd-1-5]: src/sys/kern Pull up version 1.44 from trunk: fix an LP64-B...



details:   https://anonhg.NetBSD.org/src/rev/a0e82d8c1e33
branches:  netbsd-1-5
changeset: 488594:a0e82d8c1e33
user:      fvdl <fvdl%NetBSD.org@localhost>
date:      Thu Jul 20 00:16:00 2000 +0000

description:
Pull up version 1.44 from trunk: fix an LP64-BE problem with TIOCSIG,
and a faulty bounds check for the argument.

diffstat:

 sys/kern/tty_pty.c |  13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

diffs (36 lines):

diff -r d0dd7b35a049 -r a0e82d8c1e33 sys/kern/tty_pty.c
--- a/sys/kern/tty_pty.c        Thu Jul 20 00:14:40 2000 +0000
+++ b/sys/kern/tty_pty.c        Thu Jul 20 00:16:00 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tty_pty.c,v 1.43 2000/03/30 09:27:13 augustss Exp $    */
+/*     $NetBSD: tty_pty.c,v 1.43.4.1 2000/07/20 00:16:00 fvdl Exp $    */
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -577,7 +577,7 @@
        struct pt_softc *pti = &pt_softc[minor(dev)];
        struct tty *tp = pti->pt_tty;
        u_char *cc = tp->t_cc;
-       int stop, error;
+       int stop, error, sig;
 
        /*
         * IF CONTROLLER STTY THEN MUST FLUSH TO PREVENT A HANG.
@@ -667,12 +667,13 @@
                        break;
 
                case TIOCSIG:
-                       if (*(unsigned int *)data >= NSIG)
-                               return(EINVAL);
+                       sig = (int)*data;
+                       if (sig <= 0 || sig >= NSIG)
+                               return (EINVAL);
                        if (!ISSET(tp->t_lflag, NOFLSH))
                                ttyflush(tp, FREAD|FWRITE);
-                       pgsignal(tp->t_pgrp, *(unsigned int *)data, 1);
-                       if ((*(unsigned int *)data == SIGINFO) &&
+                       pgsignal(tp->t_pgrp, sig, 1);
+                       if ((sig == SIGINFO) &&
                            (!ISSET(tp->t_lflag, NOKERNINFO)))
                                ttyinfo(tp);
                        return(0);



Home | Main Index | Thread Index | Old Index