SNDCP: Fixup based on Coverity Scan suggestion

This commit fixes Coverity Scan defect:

CID 151900:  Null pointer dereferences  (FORWARD_NULL)
Passing null pointer "comp_field->v42bis_params->nsapi"
to "memcpy", which dereferences it.

Change-Id: Iff83e21168a267dd4b4c401ab7c603e029b3ac39
This commit is contained in:
Philipp Maier 2016-11-15 19:37:05 +01:00 committed by Harald Welte
parent bb42eee113
commit 7d3093506a
1 changed files with 1 additions and 1 deletions

View File

@ -72,7 +72,7 @@ static struct gprs_sndcp_comp *gprs_sndcp_comp_create(const void *ctx,
} else if (comp_field->v44_params) {
comp_entity->nsapi_len = comp_field->v44_params->nsapi_len;
memcpy(comp_entity->nsapi,
comp_field->v42bis_params->nsapi,
comp_field->v44_params->nsapi,
sizeof(comp_entity->nsapi));
} else {
/* The caller is expected to check carefully if the all