Source-Changes-HG archive

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

[src/netbsd-8]: src/sys/net Pull up following revision(s) (requested by msait...



details:   https://anonhg.NetBSD.org/src/rev/0dfddcebe1d2
branches:  netbsd-8
changeset: 359895:0dfddcebe1d2
user:      martin <martin%NetBSD.org@localhost>
date:      Sat Jan 29 17:05:44 2022 +0000

description:
Pull up following revision(s) (requested by msaitoh in ticket #1727):

        sys/net/ppp_tty.c: revision 1.68
        sys/net/ppp_tty.c: revision 1.69

Use unsigned to avoid undefined behavior in pppasyncstart().

Use unsigned to avoid undefined behavior. Found by kUBSan.

diffstat:

 sys/net/ppp_tty.c |  10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diffs (45 lines):

diff -r 91b6062d6c1e -r 0dfddcebe1d2 sys/net/ppp_tty.c
--- a/sys/net/ppp_tty.c Sat Jan 29 16:56:18 2022 +0000
+++ b/sys/net/ppp_tty.c Sat Jan 29 17:05:44 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ppp_tty.c,v 1.63 2016/10/02 14:17:07 christos Exp $    */
+/*     $NetBSD: ppp_tty.c,v 1.63.8.1 2022/01/29 17:05:44 martin Exp $  */
 /*     Id: ppp_tty.c,v 1.3 1996/07/01 01:04:11 paulus Exp      */
 
 /*
@@ -93,7 +93,7 @@
 /* from NetBSD: if_ppp.c,v 1.15.2.2 1994/07/28 05:17:58 cgd Exp */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ppp_tty.c,v 1.63 2016/10/02 14:17:07 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ppp_tty.c,v 1.63.8.1 2022/01/29 17:05:44 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "ppp.h"
@@ -181,7 +181,7 @@
 /*
  * Does c need to be escaped?
  */
-#define ESCAPE_P(c)    (sc->sc_asyncmap[(c) >> 5] & (1 << ((c) & 0x1F)))
+#define ESCAPE_P(c)    (sc->sc_asyncmap[(c) >> 5] & (1U << ((c) & 0x1F)))
 
 /*
  * Procedures for using an async tty interface for PPP.
@@ -1012,7 +1012,7 @@
        sc->sc_flags |= SC_RCV_B7_1;
     else
        sc->sc_flags |= SC_RCV_B7_0;
-    if (paritytab[c >> 5] & (1 << (c & 0x1F)))
+    if (paritytab[c >> 5] & (1U << (c & 0x1F)))
        sc->sc_flags |= SC_RCV_ODDP;
     else
        sc->sc_flags |= SC_RCV_EVNP;
@@ -1093,7 +1093,7 @@
        return 0;
     }
 
-    if (c < 0x20 && (sc->sc_rasyncmap & (1 << c)))
+    if (c < 0x20 && (sc->sc_rasyncmap & (1U << c)))
        return 0;
 
     s = spltty();



Home | Main Index | Thread Index | Old Index