31ab249d057619895a3c5519e5777726209c5aa0
[platform/core/telephony/tel-plugin-imc.git] / packaging / 0008-Fix-SCA-service-center-address-length-checking-error.patch
1 From 5c4fbd80accf435889b6f7b16eae14b47a6cba09 Mon Sep 17 00:00:00 2001
2 From: Caiwen Zhang <caiwen.zhang@intel.com>
3 Date: Tue, 25 Sep 2012 21:28:07 +0800
4 Subject: [PATCH 08/23] Fix SCA(service center address) length checking error
5 Content-Type: text/plain; charset="utf-8"
6 Content-Transfer-Encoding: 8bit
7
8 For the address field used by SM-RL(short message relay layer),
9 the length byte represents octets of the whole field(include itself
10 and TOA byte - type of address). Please refer to 3GPP 31.102 4.2.27
11 and 3GPP 24.011 8.2.5.2
12
13 For the address field used by SM-TP(transfer layer), the length
14 represents semi-octets within the address(exclude itself and TOA
15 byte). Please refer to 3GPP 23.040 9.1.2.5.
16
17 SCA is an address filed of SM-RL. SMS_MAX_SMS_SERVICE_CENTER_ADDR
18 should be 12.
19
20 But currently in the struct telephony_sms_DataPaclageInfo, SM-TP
21 address filed is used to represent the SCA.
22
23 As we currently can't access libtcore and msg_service packages,
24 temporarily change the SCA length checking here to make SMS sending
25 work.
26 ---
27  src/s_sms.c |    2 +-
28  1 file changed, 1 insertion(+), 1 deletion(-)
29
30 diff --git a/src/s_sms.c b/src/s_sms.c
31 index 874f08e..2b3cd4f 100644
32 --- a/src/s_sms.c
33 +++ b/src/s_sms.c
34 @@ -2218,7 +2218,7 @@ static TReturn send_umts_msg(CoreObject *obj, UserRequest *ur)
35  
36         if ((sendUmtsMsg->msgDataPackage.msgLength > 0)
37                 && (sendUmtsMsg->msgDataPackage.msgLength <= SMS_SMDATA_SIZE_MAX)
38 -               && (ScLength <= SMS_SCADDRESS_LEN_MAX)) {
39 +               && (ScLength <= (SMS_MAX_SMS_SERVICE_CENTER_ADDR - 2) * 2)) {
40                 if (ScLength == 0) { // ScAddress not specified
41                         buf[0] = '0';
42                         buf[1] = '0';
43 -- 
44 1.7.10.4
45