gnokii-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: smsd and long messages


From: Pawel Kot
Subject: Re: smsd and long messages
Date: Fri, 21 Aug 2009 10:42:09 +0200

Hi,

On Fri, Aug 21, 2009 at 10:24, Hartmut Benz<address@hidden> 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?

> address@hidden:~/gnokii-0.6.26$ /home/h2o/myg/bin/smsd -u smsd -p smsd -d

Using git would help here :)

take care,
-- 
Pawel Kot




reply via email to

[Prev in Thread] Current Thread [Next in Thread]