gbproxy: Fix parser to accept GSM 24.008 Attach Req messages

Currently the parse expects a 'MS network capability' IE with
2 <= length <= 3 which is compliant to GSM 04.08, 9.4.1  but not to
GSM 24.008, 9.4.1 which specifies 3 <= length <= 9. Thus the parser
rejects messages with a length >= 4 (including length field).

This patch relaxes the length check to accept either range by
requiring 2 <= length <= 9.

Ticket: OW#1258
Sponsored-by: On-Waves ehf
This commit is contained in:
Jacob Erlbeck 2014-09-29 12:36:45 +02:00 committed by Holger Hans Peter Freyther
parent b36032cb27
commit c9cd15fbc9
1 changed files with 1 additions and 1 deletions

View File

@ -155,7 +155,7 @@ static int gprs_gb_parse_gmm_attach_req(uint8_t *data, size_t data_len,
/* Skip MS network capability */
if (lv_shift(&data, &data_len, NULL, &value_len) <= 0 ||
value_len < 1 || value_len > 2)
value_len < 1 || value_len > 8)
/* invalid */
return 0;;