Commit a4bca521 authored by Leah Neukirchen's avatar Leah Neukirchen

callback: ensure trailing nul byte

parent 1bb1b7e4
...@@ -2144,7 +2144,7 @@ callback(const char *fpath, const struct stat *sb, int depth, ino_t entries, off ...@@ -2144,7 +2144,7 @@ callback(const char *fpath, const struct stat *sb, int depth, ino_t entries, off
} }
if (need_xattr) { if (need_xattr) {
strncpy(fi->xattr, xattr_string(fi->fpath), sizeof fi->xattr); strncpy(fi->xattr, xattr_string(fi->fpath), sizeof fi->xattr - 1);
if (strlen(fi->xattr) > maxxattr) if (strlen(fi->xattr) > maxxattr)
maxxattr = strlen(fi->xattr); maxxattr = strlen(fi->xattr);
} else } else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment