RE: [PATCH v5 1/4] libusbg: Replace array lengths with defines

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

 



From: Stanislaw Wadas
> Replace hard coded value of 256 by two constant
> defines, MAX_LENGTH and MAX_PATH_LENGTH

Neither of those names is really very good.
They probably ought to be prefixed with USBG_
Mind you the rest of the file isn't much better.

There are also some 'char name[40];'

And code like:

>  static void usbg_write_buf(char *path, char *name, char *file, char *buf)
>  {
> -	char p[256];
> +	char p[MAX_LENGTH];
>  	FILE *fp;
> 
>  	sprintf(p, "%s/%s/%s", path, name, file);

Is just waiting for a security alert.

	David.


--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux