Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 7 Jan 1998 12:40:39 +0200
From:      Sakari Jalovaara <sja@tekla.fi>
To:        FreeBSD-gnats-submit@FreeBSD.ORG
Subject:   kern/5450: A couple of operator precedence bugs
Message-ID:  <9801071040.AA29427@poveri.tekla.fi>
Resent-Message-ID: <199801082232.OAA09857@hub.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         5450
>Category:       kern
>Synopsis:       A couple of operator precedence bugs
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jan  8 14:32:47 PST 1998
>Last-Modified:
>Originator:     Sakari Jalovaara
>Organization:
Ministry of Information, Information Retrieval
>Release:        FreeBSD 3.0-CURRENT i386
>Environment:

>Description:

Three places in the kernel fall for the precedence gotcha between binary
"&" and "==".  They seem like bugs; I don't know what fixing them will
do, though -- something might rely on the bugs.

>How-To-Repeat:

>Fix:

in /usr/src/sys/netinet/udp_usrreq.c
	if ((last->inp_socket->so_options&(SO_REUSEPORT|SO_REUSEADDR) == 0))
should be
	if ((last->inp_socket->so_options&(SO_REUSEPORT|SO_REUSEADDR)) == 0)

in /usr/src/sys/kern/tty_compat.c
	|| cflag&(CSIZE|PARENB) != CS8)
should be
	|| (cflag&(CSIZE|PARENB)) != CS8)

also in /usr/src/sys/kern/tty_compat.c
	if (!(flags&RAW) && !(oflag&OPOST) && cflag&(CSIZE|PARENB) == CS8)
should be
	if (!(flags&RAW) && !(oflag&OPOST) && (cflag&(CSIZE|PARENB)) == CS8)
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?9801071040.AA29427>