[PATCH] openbsc[master]: SNDCP: Fixup based on Coverity Scan suggestion

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

dexter gerrit-no-reply at lists.osmocom.org
Tue Nov 15 18:40:43 UTC 2016


Review at  https://gerrit.osmocom.org/1252

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
---
M openbsc/src/gprs/gprs_sndcp_comp.c
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/52/1252/1

diff --git a/openbsc/src/gprs/gprs_sndcp_comp.c b/openbsc/src/gprs/gprs_sndcp_comp.c
index cae0039..1591f80 100644
--- a/openbsc/src/gprs/gprs_sndcp_comp.c
+++ b/openbsc/src/gprs/gprs_sndcp_comp.c
@@ -72,7 +72,7 @@
 	} 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

-- 
To view, visit https://gerrit.osmocom.org/1252
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iff83e21168a267dd4b4c401ab7c603e029b3ac39
Gerrit-PatchSet: 1
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: dexter <pmaier at sysmocom.de>



More information about the gerrit-log mailing list