aboutsummaryrefslogtreecommitdiff
path: root/lib/tran_sock.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/tran_sock.c')
-rw-r--r--lib/tran_sock.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/tran_sock.c b/lib/tran_sock.c
index 024e5b0..5f144b2 100644
--- a/lib/tran_sock.c
+++ b/lib/tran_sock.c
@@ -217,7 +217,7 @@ tran_sock_recv_fds(int sock, struct vfio_user_header *hdr, bool is_reply,
}
if (hdr->flags & VFIO_USER_F_ERROR) {
- if (hdr->error_no <= 0) {
+ if (hdr->error_no <= 0 || hdr->error_no > SERVER_MAX_ERROR_NO) {
hdr->error_no = EINVAL;
}
return ERROR_INT(hdr->error_no);