(svn r14759) -Fix (r14730): tab completion causing out-of-bounds read.
This commit is contained in:
@@ -300,12 +300,14 @@ struct NetworkChatWindow : public QueryStringBaseWindow {
|
||||
|
||||
/* First, try clients */
|
||||
if (*item < MAX_CLIENT_SLOTS) {
|
||||
/* Skip inactive clients */
|
||||
NetworkClientInfo *ci;
|
||||
FOR_ALL_CLIENT_INFOS_FROM(ci, *item + 1) break;
|
||||
if (ci != NULL) {
|
||||
*item = ci->index;
|
||||
return ci->client_name;
|
||||
if (*item + 1 < GetNetworkClientInfoPoolSize()) {
|
||||
/* Skip inactive clients */
|
||||
NetworkClientInfo *ci;
|
||||
FOR_ALL_CLIENT_INFOS_FROM(ci, *item + 1) break;
|
||||
if (ci != NULL) {
|
||||
*item = ci->index;
|
||||
return ci->client_name;
|
||||
}
|
||||
}
|
||||
*item = MAX_CLIENT_SLOTS;
|
||||
}
|
||||
|
Reference in New Issue
Block a user