gprs: fix error check of gprs_cid_alloc function

When there is no context id available, idmap_alloc and
gprs_cid_alloc return max + 1.
This commit is contained in:
Christophe Ronco 2017-02-15 17:54:21 +01:00 committed by Denis Kenzior
parent 69c67fce7f
commit d43e48ae73
1 changed files with 1 additions and 1 deletions

View File

@ -313,7 +313,7 @@ static gboolean assign_context(struct pri_context *ctx, int use_cid)
} else
ctx->context.cid = gprs_cid_alloc(ctx->gprs);
if (ctx->context.cid == 0)
if (ctx->context.cid > idmap_get_max(cidmap))
return FALSE;
for (l = ctx->gprs->context_drivers; l; l = l->next) {