From f271d09c993cc3b1ee917fd6413837d9b38439fb Mon Sep 17 00:00:00 2001 From: Marco van Wieringen Date: Thu, 15 Oct 2009 20:49:34 +0200 Subject: [PATCH] Change bsnprintf to normal strncpy --- bacula/src/filed/xattr.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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. -- 2.39.5