정수 오버플로우 방지

pull/540/head
root 2021-11-26 17:00:38 +00:00
parent e77c69287d
commit 759518f2f1
1 changed files with 3 additions and 0 deletions

View File

@ -444,6 +444,9 @@ int fdfs_copy_tracker_group(TrackerServerGroup *pDestTrackerGroup, \
TrackerServerInfo *pDestServerEnd;
bytes = sizeof(TrackerServerInfo) * pSrcTrackerGroup->server_count;
if(bytes <0){
reutnr 0;
}
pDestTrackerGroup->servers = (TrackerServerInfo *)malloc(bytes);
if (pDestTrackerGroup->servers == NULL)
{