Re: off by one error in bttv-driver.c

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



Off by one is the sign of real programmer

Ronald Bultje wrote:

> Hi Gerd et all,
>
> I think there's a off-by-one error in bttv-driver.c (bttv 0.8.37):
> [..]
>                 if (b->index < 0 || b->index > VIDEO_MAX_FRAME)
>                         return -EINVAL;
> [..]
> twice, once for VIDIOC_QUERYBUF and once for VIDIOC_QBUF (both in the
> ioctl handler function in bttv-driver.c). It should be "b->index >=
> VIDEO_MAX_FRAME" instead of "b->index > VIDEO_MAX_FRAME".
>
> Attached is a small patch to correct that.
>
> Ronald
>
> --
> -   .-.
> -   /V\    | Ronald Bultje <rbultje@xxxxxxxxxxxxxxxxxxx>
> -  // \\   | Running: Linux 2.4.18-XFS and OpenBSD 3.0
> - /(   )\  | http://ronald.bitfreak.net/
> -  ^^-^^
>
>   ------------------------------------------------------------------------
>                             Name: bttv-off-by-one.patch
>    bttv-off-by-one.patch    Type: Plain Text (text/plain)
>                         Encoding: quoted-printable





[Index of Archives]     [Linux DVB]     [Video Disk Recorder]     [Asterisk]     [Photo]     [DCCP]     [Netdev]     [Xorg]     [Util Linux NG]     [Xfree86]     [Free Photo Albums]     [Fedora Users]     [Fedora Women]     [ALSA Users]     [ALSA Devel]     [Linux USB]

Powered by Linux