* [patch 1/2] dmaengine: xgene: buffer overflow in xgene_dma_init_channels()
@ 2015-04-09 9:05 Dan Carpenter
2015-04-17 18:17 ` Vinod Koul
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2015-04-09 9:05 UTC (permalink / raw)
To: kernel-janitors
We put 9 characters into the 8 character name[] array. Let's make the
array bigger and change the sprintf() to snprintf().
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/drivers/dma/xgene-dma.c b/drivers/dma/xgene-dma.c
index aa61935..06d4042 100755
--- a/drivers/dma/xgene-dma.c
+++ b/drivers/dma/xgene-dma.c
@@ -314,7 +314,7 @@ struct xgene_dma_chan {
struct device *dev;
int id;
int rx_irq;
- char name[8];
+ char name[10];
spinlock_t lock;
int pending;
int max_outstanding;
@@ -1876,7 +1876,7 @@ static void xgene_dma_init_channels(struct xgene_dma *pdma)
chan->dev = pdma->dev;
chan->pdma = pdma;
chan->id = i;
- sprintf(chan->name, "dmachan%d", chan->id);
+ snprintf(chan->name, sizeof(chan->name), "dmachan%d", chan->id);
}
}
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [patch 1/2] dmaengine: xgene: buffer overflow in xgene_dma_init_channels()
2015-04-09 9:05 [patch 1/2] dmaengine: xgene: buffer overflow in xgene_dma_init_channels() Dan Carpenter
@ 2015-04-17 18:17 ` Vinod Koul
0 siblings, 0 replies; 2+ messages in thread
From: Vinod Koul @ 2015-04-17 18:17 UTC (permalink / raw)
To: kernel-janitors
On Thu, Apr 09, 2015 at 12:05:04PM +0300, Dan Carpenter wrote:
> We put 9 characters into the 8 character name[] array. Let's make the
> array bigger and change the sprintf() to snprintf().
>
Applied, both
Thanks
--
~Vinod
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-04-17 18:17 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-09 9:05 [patch 1/2] dmaengine: xgene: buffer overflow in xgene_dma_init_channels() Dan Carpenter
2015-04-17 18:17 ` Vinod Koul
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).