Thread (20 messages) 20 messages, 4 authors, 2013-03-10

RE: [PATCH] drivers/tty/hvc: fixup original commit: 9276dfd27897a0b29d8b5814f39a1f82f56b6b6b

From: David Laight <hidden>
Date: 2013-03-08 11:13:33

On Fri, 2013-03-08 at 11:38 +0800, Chen Gang wrote:
quoted
  originally I did not notice src buf len and dest buf len are the =
same.
quoted
    so origianlly, it is not a bug issue, it is only for beautify =
code.
quoted
    and now, using strcpy is better.
=20
Being the same len doesn't mean it's safe to use strcpy ... the source
might be missing the 0 terminator. In this specific case though, I
believe the source string comes was itself populated with strlcpy
(at least since your patch 6b6680c4ea3952af8ae76915cbca41245147741b) =
so
strcpy is indeed safe but using strlcpy doesn't hurt does it ?
Using strlcpy() also stops someone else having to check it
again in a few years time.

	David
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help