ivshmem-server: fix possible OVERRUN
>>> CID 1337991: Memory - illegal accesses (OVERRUN) >>> Decrementing "i". The value of "i" is now 65534. 218 while (i--) { 219 event_notifier_cleanup(&peer->vectors[i]); 220 } Signed-off-by: Gonglei <arei.gonglei@huawei.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
This commit is contained in:
parent
6268520d7d
commit
258133bda9
@ -168,7 +168,9 @@ ivshmem_server_handle_new_conn(IvshmemServer *server)
|
||||
}
|
||||
if (i == G_MAXUINT16) {
|
||||
IVSHMEM_SERVER_DEBUG(server, "cannot allocate new client id\n");
|
||||
goto fail;
|
||||
close(newfd);
|
||||
g_free(peer);
|
||||
return -1;
|
||||
}
|
||||
peer->id = server->cur_id++;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user