jolly has uploaded this change for review. (
https://gerrit.osmocom.org/c/libosmocore/+/43227?usp=email )
Change subject: Add missing length check in gsm48_decode_callerid()
......................................................................
Add missing length check in gsm48_decode_callerid()
Check if octet 3a is present in case it is expected. It is expected, if
the extension flag is set in octet 3.
Related: OS#7055
Change-Id: If40e318c24048a3727fa20684af32a8106f97f4a
---
M src/gsm/gsm48_ie.c
1 file changed, 2 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/27/43227/1
diff --git a/src/gsm/gsm48_ie.c b/src/gsm/gsm48_ie.c
index 7a41ae8..e33e672 100644
--- a/src/gsm/gsm48_ie.c
+++ b/src/gsm/gsm48_ie.c
@@ -491,6 +491,8 @@
/* octet 3a */
if (!(lv[1] & 0x80)) {
+ if (in_len < 2)
+ return -EINVAL;
callerid->screen = lv[2] & 0x03;
callerid->present = (lv[2] & 0x60) >> 5;
i = 2;
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/43227?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: If40e318c24048a3727fa20684af32a8106f97f4a
Gerrit-Change-Number: 43227
Gerrit-PatchSet: 1
Gerrit-Owner: jolly <[email protected]>