All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andi Kleen <andi@firstfloor.org>
To: Shaohua Li <shaohua.li@intel.com>
Cc: linux acpi <linux-acpi@vger.kernel.org>,
	Len Brown <lenb@kernel.org>,
	Henrique de Moraes Holschuh <hmh@hmh.eng.br>,
	Holger Macht <hmacht@suse.de>, mjg59 <mjg59@srcf.ucam.org>,
	Tejun Heo <htejun@gmail.com>
Subject: Re: [patch 8/11]introduce .uevent for devices in dock
Date: Thu, 28 Aug 2008 01:37:06 +0200	[thread overview]
Message-ID: <87wsi2owrh.fsf@basil.nowhere.org> (raw)
In-Reply-To: <1219806893.32665.64.camel@sli10-desk.sh.intel.com> (Shaohua Li's message of "Wed, 27 Aug 2008 11:14:53 +0800")

Shaohua Li <shaohua.li@intel.com> 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@linux.intel.com

  reply	other threads:[~2008-08-27 23:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-27  3:14 [patch 8/11]introduce .uevent for devices in dock Shaohua Li
2008-08-27 23:37 ` Andi Kleen [this message]
  -- strict thread matches above, loose matches on Subject: below --
2008-08-28  2:06 Shaohua Li

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87wsi2owrh.fsf@basil.nowhere.org \
    --to=andi@firstfloor.org \
    --cc=hmacht@suse.de \
    --cc=hmh@hmh.eng.br \
    --cc=htejun@gmail.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=mjg59@srcf.ucam.org \
    --cc=shaohua.li@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.