Module Name: src Committed By: martin Date: Sat Jan 29 17:03:53 UTC 2022
Modified Files: src/sys/net [netbsd-9]: ppp_tty.c Log Message: Pull up following revision(s) (requested by msaitoh in ticket #1411): 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. To generate a diff of this commit: cvs rdiff -u -r1.65 -r1.65.4.1 src/sys/net/ppp_tty.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/net/ppp_tty.c diff -u src/sys/net/ppp_tty.c:1.65 src/sys/net/ppp_tty.c:1.65.4.1 --- src/sys/net/ppp_tty.c:1.65 Thu Jan 24 09:31:09 2019 +++ src/sys/net/ppp_tty.c Sat Jan 29 17:03:53 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: ppp_tty.c,v 1.65 2019/01/24 09:31:09 knakahara Exp $ */ +/* $NetBSD: ppp_tty.c,v 1.65.4.1 2022/01/29 17:03:53 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.65 2019/01/24 09:31:09 knakahara Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ppp_tty.c,v 1.65.4.1 2022/01/29 17:03:53 martin Exp $"); #ifdef _KERNEL_OPT #include "ppp.h" @@ -181,7 +181,7 @@ static void pppdumpframe(struct ppp_soft /* * 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. @@ -1021,7 +1021,7 @@ pppinput(int c, struct tty *tp) 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; @@ -1102,7 +1102,7 @@ pppinput(int c, struct tty *tp) return 0; } - if (c < 0x20 && (sc->sc_rasyncmap & (1 << c))) + if (c < 0x20 && (sc->sc_rasyncmap & (1U << c))) return 0; s = spltty();