diff options
Diffstat (limited to 'src/vhost_user/message.rs')
-rw-r--r-- | src/vhost_user/message.rs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/vhost_user/message.rs b/src/vhost_user/message.rs index ccaa6b8..5d4467e 100644 --- a/src/vhost_user/message.rs +++ b/src/vhost_user/message.rs @@ -584,11 +584,9 @@ impl VhostUserMsgValidator for VhostUserConfig { fn is_valid(&self) -> bool { if (self.flags & !VhostUserConfigFlags::all().bits()) != 0 { return false; - } else if self.offset < VHOST_USER_CONFIG_OFFSET - || self.offset >= VHOST_USER_CONFIG_SIZE - || self.size == 0 - || self.size > (VHOST_USER_CONFIG_SIZE - VHOST_USER_CONFIG_OFFSET) - || self.size + self.offset > VHOST_USER_CONFIG_SIZE + } else if self.size == 0 + || self.size > VHOST_USER_CONFIG_SIZE + || self.size + self.offset >= VHOST_USER_CONFIG_SIZE { return false; } |