Re: [patch 8/11]introduce .uevent for devices in dock

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

 



Shaohua Li <shaohua.li@xxxxxxxxx> writes:

> +static void ata_acpi_uevent(struct ata_port *ap, struct ata_device *dev,
> +	u32 event)
> +{
> +	struct kobject *kobj = NULL;
> +	char event_string[12];
> +	char *envp[] = { event_string, NULL };
> +
> +	if (dev) {
> +		if (dev->sdev)
> +			kobj = &dev->sdev->sdev_gendev.kobj;
> +	} else
> +		kobj = &ap->dev->kobj;
> +
> +	if (kobj) {
> +		sprintf(event_string, "BAY_EVENT=%d", event);

That will overflow when event is more than one digit. Is that
enforced? Should be buffer be larger? snprintf is safer

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

[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux