Re: hex to binary conversion for xml post

"Nikos Balkanas" <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Message-ID <5D00A27CF89947E786230809F2AE5A27@drwho>
Hi,

This is a bug. Code scans your text for any non-hex chars. Since all chars, 
12345 are valid hex chars, it assumes that text is in hex and tries to 
decode it. It should be fixed to require the '%' for url-encoded hex chars.

BR,
Nikos
----- Original Message ----- 
From: Emanuele Carbone
To: [email protected]
Sent: Wednesday, March 02, 2011 4:08 PM
Subject: hex to binary conversion for xml post


Hi guys,


i tried to send a simple sms with this text "12345"  (without quotes). The 
request was done in XML POST  and i have received a strange sequence of 
character. But  if the same request is done in GET i receive the correct 
message. Smsbox when received a xml request extract the text so:


/* text */
    text = NULL;
    get_tag(*body, octstr_imm("ud"), &tmp, 0, 0);
    if(tmp) {
O_DESTROY(text);
text = octstr_duplicate(tmp);
if(octstr_hex_to_binary(text) == -1)
   octstr_url_decode(text);
O_DESTROY(tmp);
    }


with the text 12345: (but it is true for the all hex symbols)


octstr_check_range(ostr, 0, ostr->len, gw_isxdigit) is valid


and the function convert ascii data to binary values. This action compromise 
my text.


I don't understand why for xml request smsbox do this check.




Please, can anyone explain the reason?!


thanks in advance
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.