Revision 9238c209

b/hw/9pfs/virtio-9p-posix-acl.c
44 44
        return -1;
45 45
    }
46 46

  
47
    strncpy(value, ACL_ACCESS, len);
47
    /* len includes the trailing NUL */
48
    memcpy(value, ACL_ACCESS, len);
48 49
    return 0;
49 50
}
50 51

  
......
95 96
        return -1;
96 97
    }
97 98

  
98
    strncpy(value, ACL_DEFAULT, len);
99
    /* len includes the trailing NUL */
100
    memcpy(value, ACL_ACCESS, len);
99 101
    return 0;
100 102
}
101 103

  
b/hw/9pfs/virtio-9p-xattr-user.c
61 61
        return -1;
62 62
    }
63 63

  
64
    strncpy(value, name, name_size);
64
    /* name_size includes the trailing NUL. */
65
    memcpy(value, name, name_size);
65 66
    return name_size;
66 67
}
67 68

  
b/hw/9pfs/virtio-9p-xattr.c
53 53
        return -1;
54 54
    }
55 55

  
56
    strncpy(value, name, name_size);
56
    /* no need for strncpy: name_size is strlen(name)+1 */
57
    memcpy(value, name, name_size);
57 58
    return name_size;
58 59
}
59 60

  

Also available in: Unified diff