mgcp: Return with NULL if we fail the size check.

This commit is contained in:
Holger Hans Peter Freyther
2011-01-07 11:36:54 +01:00
parent f43f2fce82
commit 45c2184c7e

View File

@@ -290,6 +290,7 @@ static struct mgcp_endpoint *find_e1_endpoint(struct mgcp_config *cfg,
mgcp_endp = mgcp_timeslot_to_endpoint(trunk - 1, endp);
if (mgcp_endp < 1 || mgcp_endp >= cfg->number_endpoints) {
LOGP(DMGCP, LOGL_ERROR, "Failed to find endpoint '%s'\n", mgcp);
return NULL;
}
return &cfg->endpoints[mgcp_endp];