Source-Changes-HG archive

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

[src/trunk]: src/sys/net Use unsigned to avoid undefined behavior in pppasync...



details:   https://anonhg.NetBSD.org/src/rev/ffe5f98f5bf0
branches:  trunk
changeset: 987465:ffe5f98f5bf0
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Mon Sep 27 07:13:30 2021 +0000

description:
Use unsigned to avoid undefined behavior in pppasyncstart().

Reported-by: syzbot+7c8c7977e2756ac13f0a%syzkaller.appspotmail.com@localhost

diffstat:

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

diffs (27 lines):

diff -r 2721ef0ba564 -r ffe5f98f5bf0 sys/net/ppp_tty.c
--- a/sys/net/ppp_tty.c Mon Sep 27 00:51:10 2021 +0000
+++ b/sys/net/ppp_tty.c Mon Sep 27 07:13:30 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ppp_tty.c,v 1.67 2020/01/29 04:28:27 thorpej Exp $     */
+/*     $NetBSD: ppp_tty.c,v 1.68 2021/09/27 07:13:30 msaitoh 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.67 2020/01/29 04:28:27 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ppp_tty.c,v 1.68 2021/09/27 07:13:30 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "ppp.h"
@@ -168,7 +168,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.



Home | Main Index | Thread Index | Old Index