Subject: Re: CVS commit: src/sys/dev/ic
To: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
From: Christos Zoulas <christos@zoulas.com>
List: source-changes
Date: 09/03/2006 15:29:28
On Sep 4,  4:10am, tsutsui@ceres.dti.ne.jp (Izumi Tsutsui) wrote:
-- Subject: Re: CVS commit: src/sys/dev/ic

| > | Isn't it better to make sc_dleft signed?
| > | (maybe this code should be wrapped by #ifdef DIAGNOSTIC anyway)
| > 
| > I think that keeping things unsigned makes the code simpler. Having
| > the checks always in the kernel prevents buffer overflows and crashes.
| 
| But you #if 0'ed out a check ("data xfered more than requested bytes")
| which didn't work as intended because sc_dleft was unsigned.

Yes, either the driver broke when sc_dleft was changed to unsigned or
the test is unnecessary, and we need to add more tests to check that
sc_dleft does not exceed the number of bytes in the request.

christos