ivshmem: print error on invalid peer id

The server shouldn't send invalid peer id, so print an error if it's the
case.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Claudio Fontana <claudio.fontana@huawei.com>
This commit is contained in:
Marc-André Lureau 2015-06-23 13:34:09 +02:00
parent 36617792b4
commit ffa99afd6e
1 changed files with 1 additions and 0 deletions

View File

@ -399,6 +399,7 @@ static void close_guest_eventfds(IVShmemState *s, int posn)
return;
}
if (posn < 0 || posn >= s->nb_peers) {
error_report("invalid peer %d", posn);
return;
}