fix potential overflow

This commit is contained in:
Max Lv
2015-01-23 15:43:23 +08:00
parent 786360546a
commit 86b78dedd7
4 changed files with 15 additions and 7 deletions
+3 -1
View File
@@ -1043,7 +1043,9 @@ int main(int argc, char **argv)
}
break;
case 's':
server_host[server_num++] = optarg;
if (server_num < MAX_REMOTE_NUM) {
server_host[server_num++] = optarg;
}
break;
case 'p':
server_port = optarg;