mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-10-30 22:18:21 +00:00
iovec: fix vulnerability
This commit is contained in:
@@ -9,7 +9,7 @@ static inline bool iovec_iterator_finished(iovec_iterator_t *iovec_iterator) {
|
|||||||
bool iovec_user_check(iovec_t *iovec, size_t count) {
|
bool iovec_user_check(iovec_t *iovec, size_t count) {
|
||||||
for (int i = 0; i < count; ++i) {
|
for (int i = 0; i < count; ++i) {
|
||||||
// POSIX says that when len is zero, the addr can be an invalid buffer
|
// POSIX says that when len is zero, the addr can be an invalid buffer
|
||||||
if (iovec->len && IS_USER_ADDRESS(iovec[i].addr) == false)
|
if (iovec[i].len && IS_USER_ADDRESS(iovec[i].addr) == false)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user