patchgnokii - Patches: patch #6189, nk6100: DeleteSMSMessage segfaults...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

patch #6189: nk6100: DeleteSMSMessage segfaults when called from CheckIncomingSMS (--smsreader)

Submitter:  None
Submitted:  Thu 06 Sep 2007 07:00:39 PM UTC
   
 
Category:  phone driver Priority:  5 - Normal
Status:  Done Privacy:  Public
Assigned to:  None Originator Email:  -email is unavailable-
Open/Closed:  Closed

Sun 09 Sep 2007 06:01:02 PM UTC, comment #1: 

Applied with the only change of clearing raw_sms before use.

Thank you.

Daniele Forsi <dforsi>
Group administrator
Thu 06 Sep 2007 07:00:39 PM UTC, original submission:  

Hi,

Found a bug from nk6100 phone driver. DeleteSMSMessage causes a segfault when called from CheckIncomingSMS - this is due to uninitialized raw_sms variable. Attached patch corrects this fault.

Br,
 Sami

diff -upr orig/common/phones/nk6100.c gnokii-0.6.18/common/phones/nk6100.c
--- orig/common/phones/nk6100.c 2007-09-06 21:28:25.000000000 +0300
+++ gnokii-0.6.18/common/phones/nk6100.c        2007-09-06 21:41:49.000000000 +0300
@@ -1338,6 +1338,7 @@ static bool CheckIncomingSMS(struct gn_s
 {
        gn_data data;
        gn_sms sms;
+       gn_sms_raw rawsms;
        gn_error error;

        if (!DRVINSTANCE(state)->on_sms) {
@@ -1355,8 +1356,8 @@ static bool CheckIncomingSMS(struct gn_s
        DRVINSTANCE(state)->sms_notification_in_progress = true;

        memset(&sms, 0, sizeof(sms));
-       sms.memory_type = GN_MT_SM;
-       sms.number = pos;
+       rawsms.memory_type = sms.memory_type = GN_MT_SM;
+       rawsms.number = sms.number = pos;
        gn_data_clear(&data);
        data.sms = &sms;

@@ -1370,7 +1371,10 @@ static bool CheckIncomingSMS(struct gn_s

        dprintf("deleting sms#%hd\n", sms.number);
        gn_data_clear(&data);
-       data.sms = &sms;
+        rawsms.memory_type = sms.memory_type;
+        rawsms.number = sms.number = pos;
+        data.sms = &sms;
+        data.raw_sms = &rawsms;
        DeleteSMSMessage(&data, state);

        DRVINSTANCE(state)->sms_notification_in_progress = false;


Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by dforsi (Posted a comment)
  • -email is unavailable- added by None (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2007-09-09 dforsi Open/ClosedOpen Closed
    2007-09-09 dforsi StatusNone Done

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code