From: Marco van Wieringen Date: Thu, 15 Oct 2009 18:49:34 +0000 (+0200) Subject: Change bsnprintf to normal strncpy X-Git-Tag: Release-7.0.0~2602^2~1^2~4^2~3 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=61ca17e53458032c8b172f638920a24913189348;p=bacula%2Fbacula Change bsnprintf to normal strncpy --- diff --git a/bacula/src/filed/xattr.c b/bacula/src/filed/xattr.c index 873c16feb3..0120c7b379 100644 --- a/bacula/src/filed/xattr.c +++ b/bacula/src/filed/xattr.c @@ -728,11 +728,12 @@ static bxattr_exit_code bsd_build_xattr_streams(JCR *jcr, FF_PKT *ff_pkt) skip_xattr = false; /* - * print the current name into the buffer as its not null terminated we need to + * Print the current name into the buffer as its not null terminated we need to * use the length encoded in the string for copying only the needed bytes. */ - bsnprintf(current_attrname, sizeof(current_attrname), "%*.*s", - xattr_list[index], xattr_list[index], xattr_list + (index + 1)); + cnt = MIN((sizeof(current_attrname) - 1), xattr_list[index]); + strncpy(current_attrname, xattr_list + (index + 1), cnt); + current_attrname[cnt] = '\0'; /* * First make a xattr tuple of the current namespace and the name of the xattr.