Skip to content

Commit

Permalink
Enforce trailing \0 when receiving xattr name values.
Browse files Browse the repository at this point in the history
Fixes bug 13112.
  • Loading branch information
Wayne Davison committed Nov 5, 2017
1 parent bc112b0 commit 47a63d9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions xattrs.c
Original file line number Diff line number Diff line change
Expand Up @@ -824,6 +824,10 @@ void receive_xattr(int f, struct file_struct *file)
out_of_memory("receive_xattr");
name = ptr + dget_len + extra_len;
read_buf(f, name, name_len);
if (name_len < 1 || name[name_len-1] != '\0') {
rprintf(FERROR, "Invalid xattr name received (missing trailing \\0).\n");
exit_cleanup(RERR_FILEIO);
}
if (dget_len == datum_len)
read_buf(f, ptr, dget_len);
else {
Expand Down

0 comments on commit 47a63d9

Please sign in to comment.