Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1610160
| Path | csiph.com!aioe.org!bofh.it!news.nic.it!robomod |
|---|---|
| From | "Kim, Milo" <milo.kim@ti.com> |
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] power: supply: lp8788: prevent out of bounds array access |
| Date | Tue, 28 Mar 2017 01:30:02 +0200 |
| Message-ID | <tpMfg-7ds-3@gated-at.bofh.it> (permalink) |
| References | <toWqm-3ex-17@gated-at.bofh.it> |
| Dkim-Signature | v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1490657031; bh=cVAx7tYNdFX8MqgTDqia3k+W1y7fhnPLisVZuMLlVfg=; h=Subject:To:References:CC:From:Date:In-Reply-To; b=Hec/c2v5OGVon9bwB6L6aPQhaPUM+5WZfPpqPah1JvL+DxNzjynPcMCX283p3TUpH gZom77Tamku3RnPnnIEUwtOpAL671yUGiPiUUpTIauUgbO9TMs6iHIS5hSdXhIsDeJ /QuCWDTm/4l0ELcIGiZfweAM7oLLqu+VEA5wzdUU= |
| User-Agent | Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 |
| MIME-Version | 1.0 |
| Content-Type | text/plain; charset="utf-8"; format=flowed |
| Content-Transfer-Encoding | 8bit |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 28 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | <sre@kernel.org>, <linux-pm@vger.kernel.org>, <linux-kernel@vger.kernel.org> |
| X-Original-Date | Tue, 28 Mar 2017 08:23:43 +0900 |
| X-Original-Message-ID | <84e9b377-30c6-d0f2-b869-6382d6c9f770@ti.com> |
| X-Original-References | <20170325160049.18943-1-giedrius.statkevicius@gmail.com> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1610160 |
Show key headers only | View raw
On 3/26/2017 1:00 AM, Giedrius Statkevičius wrote:
> val might become 7 in which case stime[7] (array of length 7) would be
> accessed during the scnprintf call later and that will cause issues.
> Obviously, string concatenation is not intended here so just a comma needs
> to be added to fix the issue.
>
> Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@gmail.com>
Acked-by: Milo Kim <milo.kim@ti.com>
> ---
> drivers/power/supply/lp8788-charger.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/power/supply/lp8788-charger.c b/drivers/power/supply/lp8788-charger.c
> index 509e2b341bd6..677f7c40b25a 100644
> --- a/drivers/power/supply/lp8788-charger.c
> +++ b/drivers/power/supply/lp8788-charger.c
> @@ -651,7 +651,7 @@ static ssize_t lp8788_show_eoc_time(struct device *dev,
> {
> struct lp8788_charger *pchg = dev_get_drvdata(dev);
> char *stime[] = { "400ms", "5min", "10min", "15min",
> - "20min", "25min", "30min" "No timeout" };
> + "20min", "25min", "30min", "No timeout" };
> u8 val;
>
> lp8788_read_byte(pchg->lp, LP8788_CHG_EOC, &val);
>
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH] power: supply: lp8788: prevent out of bounds array access Giedrius Statkevičius <giedrius.statkevicius@gmail.com> - 2017-03-25 17:10 +0100
Re: [PATCH] power: supply: lp8788: prevent out of bounds array access "Kim, Milo" <milo.kim@ti.com> - 2017-03-28 01:30 +0200
Re: [PATCH] power: supply: lp8788: prevent out of bounds array access Giedrius Statkevičius <giedrius.statkevicius@gmail.com> - 2017-04-08 13:00 +0200
csiph-web