Fix possible NULL to atoi

Fix possible NULL to atoi
This commit is contained in:
MassimilianoPinto
2015-03-09 18:19:25 +01:00
parent 7af2843bcb
commit 65465b11f5

View File

@ -781,7 +781,7 @@ int error_count = 0;
/* if id is not set, do it now */
if (gateway.id == 0) {
setipaddress(&serv_addr.sin_addr, (address == NULL) ? "0.0.0.0" : address);
gateway.id = (unsigned long) (serv_addr.sin_addr.s_addr + atoi(port) + getpid());
gateway.id = (unsigned long) (serv_addr.sin_addr.s_addr + port != NULL ? atoi(port) : 0 + getpid());
}
if (service && socket && protocol) {