[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: smsd and long messages
From: |
Hartmut Benz |
Subject: |
Re: smsd and long messages |
Date: |
Fri, 21 Aug 2009 10:24:25 +0200 |
User-agent: |
Thunderbird 2.0.0.22 (X11/20090608) |
Pawel Kot wrote:
> Hi,
>
> On Fri, Aug 21, 2009 at 09:35, Hartmut Benz<address@hidden> wrote:
>
>> Thanks for the reply. What's not working is that the message is cut at
>> 160th char and the reset does not arrive at the recipient. No error
>> messages I could detect. I attach three traces.
>>
>
> 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.
>
>
>> model = 3110
>>
>
> This one is not correct. Make it series40.
>
> take care,
>
Hi Pawel,
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';
Both terminate with a buffer overflow
/Hartmut
address@hidden:~/gnokii-0.6.26$ /home/h2o/myg/bin/smsd -u smsd -p smsd -d
smsd -c localhost -m pq --inbox IN -f /tmp/smsdaemon.log -i 10
LOG: debug mask is
0x1
LOG: xdebug mask is
0x1
Config read from file
/home/h2o/.gnokiirc.
phone instance
config:
model =
series40
port =
1
connection =
dku2libusb
initlength =
default
serial_baudrate =
19200
serial_write_usleep =
-1
handshake =
software
require_dcd =
0
smsc_timeout =
10
rfcomm_channel =
1
sm_retry =
0
Connecting
Serial device: opening device
USB
*** buffer overflow detected ***: /home/h2o/myg/bin/smsd
terminated
======= Backtrace:
=========
/lib/tls/i686/cmov/libc.so.6(__fortify_fail+0x48)[0xb7da8da8]
/lib/tls/i686/cmov/libc.so.6[0xb7da6eb0]
/lib/tls/i686/cmov/libc.so.6[0xb7da6495]
/home/h2o/myg//lib/smsd/libsmsd_pq.so(DB_Look+0x434)[0xb7b1a4b4]
/home/h2o/myg/bin/smsd[0x8049d42]
/lib/tls/i686/cmov/libpthread.so.0[0xb7e634ff]
/lib/tls/i686/cmov/libc.so.6(clone+0x5e)[0xb7d8f49e]
======= Memory map:
========
08048000-0804d000 r-xp 00000000 08:05 451060
/home/h2o/myg/bin/smsd
....