[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gnokii-users
Subject:    Re: smsd and long messages SOLVED
From:       Hartmut Benz <Hartmut.Benz () ti-wmc ! nl>
Date:       2009-08-21 8:49:34
Message-ID: 4A8E5F9E.3080707 () ti-wmc ! nl
[Download RAW message or body]

Pawel Kot wrote:
> Hi,
>
> On Fri, Aug 21, 2009 at 10:24, Hartmut Benz<Hartmut.Benz@ti-wmc.nl> wrote:
>   
>>> I looked into the sources. Have a look at smsd/pq.c
>>> There's a line:
>>> strncpy ((gchar *) sms.user_data[0].u.text, PQgetvalue (res1, i, 2),
>>> GN_SMS_MAX_LENGTH + 1);
>>> Change there GN_SMS_MAX_LENGTH with GN_SMS_LONG_MAX_LENGTH. That should make it.
>>>       
>
> Just checked. That should be:
> 10 * GN_SMS_MAX_LENGTH + 1
>
>   
>> I changed it to this (first only the first line, then the second as well):
>>    strncpy ((gchar *) sms.user_data[0].u.text, PQgetvalue (res1, i, 2),
>> GN_SMS_LONG_MAX_LENGTH + 1);
>>    sms.user_data[0].u.text[GN_SMS_LONG_MAX_LENGTH] = '\0';
>>     
> Use the new value here as well.
>   
>> Both terminate with a buffer overflow
>>     
> Are you able to gdb to see in which line it segfaults
>> h2o@h2o-smsgw:~/gnokii-0.6.26$ /home/h2o/myg/bin/smsd -u smsd -p smsd -d
>>     
> Using git would help here :)
>
> take care,
>   
Success - with this mod I've got the complete message transferred!

Thank's a lot for the fast and efficient help!

I'll try the newest git version as soon as possible to see if it works
with the 3109 classic without my 'hack' :-)

Take care
    /Hartmut




_______________________________________________
gnokii-users mailing list
gnokii-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/gnokii-users
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic