fat: dosfs_read_attr used the user buffer directly
It now uses user_strlcpy().
This commit is contained in:
@@ -233,8 +233,10 @@ dosfs_read_attr(fs_volume *_vol, fs_vnode *_node, void *_cookie, off_t pos,
|
|||||||
return EINVAL;
|
return EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
strncpy(buffer, node->mime + pos, *_length - 1);
|
if (user_strlcpy(buffer, node->mime + pos, *_length) < B_OK) {
|
||||||
((char *)buffer)[*_length - 1] = 0;
|
UNLOCK_VOL(vol);
|
||||||
|
return B_BAD_ADDRESS;
|
||||||
|
}
|
||||||
*_length = strlen(buffer) + 1;
|
*_length = strlen(buffer) + 1;
|
||||||
|
|
||||||
UNLOCK_VOL(vol);
|
UNLOCK_VOL(vol);
|
||||||
|
|||||||
Reference in New Issue
Block a user