Re: [PATCH 3/3] topology: Check address and length before string copy

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

 



> -----Original Message-----
> From: Takashi Sakamoto [mailto:o-takashi@xxxxxxxxxxxxx]
> Sent: Tuesday, July 19, 2016 5:45 PM
> To: mengdong.lin@xxxxxxxxxxxxxxx; alsa-devel@xxxxxxxxxxxxxxxx;
> broonie@xxxxxxxxxx
> Cc: tiwai@xxxxxxx; Girdwood, Liam R; Lin, Mengdong
> Subject: Re: [PATCH 3/3] topology: Check address and length before string
> copy
> 
> Hi,
> 
> On Jul 19 2016 17:52, mengdong.lin@xxxxxxxxxxxxxxx wrote:
> > From: Mengdong Lin <mengdong.lin@xxxxxxxxxxxxxxx>
> >
> > Signed-off-by: Mengdong Lin <mengdong.lin@xxxxxxxxxxxxxxx>
> 
> The cover letter addresses this patch fixes a compiler warning. In this case,
> it's better to write the message in commit message, I think. Like:
> http://mailman.alsa-project.org/pipermail/alsa-devel/2016-July/110097.ht
> ml
> 
> This is not just from my taste. Maintainers prefer. At least, blank commit
> messages are not preferrable in general.

Yes, that would be better. I'll fix this in v2 tomorrow.

Thanks
Mengdong

> 
> > diff --git a/src/topology/tplg_local.h b/src/topology/tplg_local.h
> > index 4d79aa7..cfde4cc 100644
> > --- a/src/topology/tplg_local.h
> > +++ b/src/topology/tplg_local.h
> > @@ -253,6 +253,9 @@ struct tplg_elem*
> tplg_elem_new_common(snd_tplg_t
> > *tplg,
> >
> >   static inline void elem_copy_text(char *dest, const char *src, int len)
> >   {
> > +	if (!dest || !src || !len)
> > +		return;
> > +
> >   	strncpy(dest, src, len);
> >   	dest[len - 1] = 0;
> >   }
> 
> 
> Regards
> 
> Takashi Sakamoto
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux