gnokii-users
[Top][All Lists]
Advanced

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

Re: GN_OP_OnSMS in nk6510


From: Pawel Kot
Subject: Re: GN_OP_OnSMS in nk6510
Date: Tue, 3 Jul 2007 23:25:02 +0200

Hi,

On 7/3/07, Bastien Nocera <address@hidden> wrote:
On Tue, 2007-07-03 at 22:56 +0200, Pawel Kot wrote:
> Hi,
>
> On 7/3/07, Bastien Nocera <address@hidden> wrote:
> > Program received signal SIGSEGV, Segmentation fault.
> > 0x00002aaaaaae4292 in NK6510_GetSMS (data=0x622be8, state=0x622810) at 
nk6510.c:1238
> > 1238            data->raw_sms->number = 
data->sms_folder->locations[data->raw_sms->number - 1];
>
> Could you check what data->raw_sms->number is before that line?

Message: SMS Folder status received
Message: Number of Entries: 20
Message: IDs of Entries : 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 
6, 5, 4, 3, 2, 1,

Breakpoint 2, NK6510_GetSMS (data=0x622be8, state=0x622810) at nk6510.c:1236
1236            if (error != GN_ERR_NONE) return error;
(gdb) p data->raw_sms->number
$1 = 0

Will take a deeper look but here's the sanity check:
diff -u -r1.229 nk6510.c
--- common/phones/nk6510.c      3 Jun 2007 13:49:58 -0000       1.229
+++ common/phones/nk6510.c      3 Jul 2007 21:23:46 -0000
@@ -1180,7 +1180,10 @@
       dprintf("Deleting SMS...\n");

       error = ValidateSMS(data, state);
-       if (error != GN_ERR_NONE) return error;
+       if (error != GN_ERR_NONE)
+               return error;
+       if (data->raw_sms->number < 1)
+               return GN_ERR_EMPTYLOCATION;

       data->raw_sms->number =
data->sms_folder->locations[data->raw_sms->number - 1];


take care,
pkot
--
Pawel Kot




reply via email to

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