Browse Source

engine: client: netgraph: fix few global-buffer-overflow errors

pull/2/head
Alibek Omarov 2 years ago
parent
commit
1ba117a8e9
  1. 10
      engine/client/cl_netgraph.c

10
engine/client/cl_netgraph.c

@ -281,7 +281,10 @@ static void NetGraph_DrawTimes( wrect_t rect, int x, int w ) @@ -281,7 +281,10 @@ static void NetGraph_DrawTimes( wrect_t rect, int x, int w )
for( j = start; j < h; j++ )
{
NetGraph_DrawRect( &fill, netcolors[NETGRAPH_NET_COLORS + j + extrap_point] );
int color = NETGRAPH_NET_COLORS + j + extrap_point;
color = Q_min( color, ARRAYSIZE( netcolors ) - 1 );
NetGraph_DrawRect( &fill, netcolors[color] );
fill.top--;
}
}
@ -297,7 +300,10 @@ static void NetGraph_DrawTimes( wrect_t rect, int x, int w ) @@ -297,7 +300,10 @@ static void NetGraph_DrawTimes( wrect_t rect, int x, int w )
for( j = 0; j < h; j++ )
{
NetGraph_DrawRect( &fill, netcolors[NETGRAPH_NET_COLORS + j + oldh] );
int color = NETGRAPH_NET_COLORS + j + oldh;
color = Q_min( color, ARRAYSIZE( netcolors ) - 1 );
NetGraph_DrawRect( &fill, netcolors[color] );
fill.top--;
}
}

Loading…
Cancel
Save