[sheepdog] [PATCH] avoid strcpy and strncpy

MORITA Kazutaka morita.kazutaka at lab.ntt.co.jp
Tue Oct 30 01:47:13 CET 2012


At Fri, 26 Oct 2012 13:02:43 +0900,
MORITA Kazutaka wrote:
> 
> strcpy has a risk of buffer overflow, and strncpy may not set '\0' to
> the destination buffer.  This patch introduces pstrcpy to copy strings
> safely.
> 
> Signed-off-by: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>
> ---
>  collie/cluster.c  |    7 ++++---
>  collie/treeview.c |    6 +++---
>  collie/vdi.c      |   26 +++++++++++++-------------
>  include/util.h    |    1 +
>  lib/logger.c      |    8 ++++----
>  lib/util.c        |   27 +++++++++++++++++++++++++++
>  sheep/config.c    |    2 +-
>  sheep/group.c     |    2 +-
>  sheep/journal.c   |    4 ++--
>  sheep/vdi.c       |    2 +-
>  10 files changed, 57 insertions(+), 28 deletions(-)

Applied.

Kazutaka



More information about the sheepdog mailing list