On Thursday 17 November 2005 11:51, Sigmund Augdal Helberg wrote:
> The following small patch fixes a stack overflow and subsequent
> segfault in ivtv-detect.
>
> Signed-off-by: Sigmund Augdal Helberg <[EMAIL PROTECTED]>
> Index: ivtv-detect.c
> ===================================================================
> --- ivtv-detect.c (revision 2972)
> +++ ivtv-detect.c (working copy)
> @@ -32,7 +32,7 @@
>
> // device -1 is a special code for the device names without a number
> #define MINDEV -1
> -#define MAXDEV 15
> +#define MAXDEV 100
>
> struct stream_info {
> char name[100];
> @@ -104,7 +104,7 @@
> int maxdev = 0;
> int i;
>
> - for (i = -1; i < 100; i++) {
> + for (i = MINDEV; i < MAXDEV; i++) {
> char num[10] = "";
> int j;
Applied. Thank you!
This code should really be rewritten in C++, it was originally quickly
hacked together, but it is quite useful and deserves better code.
Hans
_______________________________________________
ivtv-devel mailing list
[email protected]
http://ivtvdriver.org/mailman/listinfo/ivtv-devel