Subject: Re: CVS commit: src/sys/dev/wscons
To: None <christos@netbsd.org>
From: Julio M. Merino Vidal <jmmv84@gmail.com>
List: source-changes
Date: 02/10/2006 18:41:33
On Friday 10 February 2006 18:33, Christos Zoulas wrote:
> Module Name:	src
> Committed By:	christos
> Date:		Fri Feb 10 17:33:02 UTC 2006
>
> Modified Files:
> 	src/sys/dev/wscons: wsmouse.c
>
> Log Message:
> PR/32794: Paul Shupak: Panic in wsmouse code.
> Checking the number of events after you've trashed the stack is not very
> useful. Instead, break out of the loop if we ran out, printing a message.

Maybe there should be assertions just before each attempt to modify
events[nevents] to ensure that nevents is low enough.

But... given the way the events vector is sized (to which you added a
comment), in which situation can it overflow?

> Also don't try to inject 0 events; reset our state instead. Maybe having

Theorically the input function is called when there is, at least, an event
to process (this is stated in a comment at the beginning of the function).
Therefore, nevents == 0 cannot happen, isn't it?

-- 
Julio M. Merino Vidal <jmmv84@gmail.com>
The Julipedia - http://julipedia.blogspot.com/