From c0847d641c2a46e091b349467899df93bcc3cf5c Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Wed, 8 May 2019 23:55:58 +0200 Subject: [PATCH] SMPP: Don't accept password or system-id exceeding spec length The SMPP 3.4 specification defines the password field as a "Variable-length octet string with maximum length of 9", and according to table 3-1 this means including the terminating NUL-byte. However, OsmoMSC allows to configure longer passwords in the ESME configuration. Those passwords will then never match, as libsmpp34 performs length validation and generates a parser error for anyone trying to send a longer password via SMPP. The same applies for system-id, where we have to permit only 15 characters with zero termination, but not 16 characters. Change-Id: I81ef593e84bf1e15f6746386fc145495fae29354 Closes: OS#3166 --- src/libmsc/smpp_smsc.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libmsc/smpp_smsc.h b/src/libmsc/smpp_smsc.h index 1c9eae68e..b26d01126 100644 --- a/src/libmsc/smpp_smsc.h +++ b/src/libmsc/smpp_smsc.h @@ -13,8 +13,8 @@ #include #include -#define SMPP_SYS_ID_LEN 16 -#define SMPP_PASSWD_LEN 16 +#define SMPP_SYS_ID_LEN 15 +#define SMPP_PASSWD_LEN 8 #define MODE_7BIT 7 #define MODE_8BIT 8