gnokii-users
[Top][All Lists]
Advanced

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

3110 robustness fix (patch)


From: Osma Suominen
Subject: 3110 robustness fix (patch)
Date: Sun, 16 Feb 2003 17:38:51 +0200 (EET)

Hi,

here's a piece of code that makes the 3110 driver a bit more robust
i.e. doesn't segfault on unexpectedly arriving SMS headers.

-Osma

diff -u -r1.29 nk3110.c
--- nk3110.c    14 Feb 2003 23:54:12 -0000      1.29
+++ nk3110.c    16 Feb 2003 15:37:20 -0000
@@ -801,6 +801,11 @@
        gn_gsm_number_type smsc_number_type, remote_number_type;
        unsigned char smsc[256], remote[256];   /* should be enough for anyone 
*/

+       if(!data->raw_sms) {
+               dprintf("Unrequested SMS header received. Ignoring.\n");
+               return GN_ERR_INTERNALERROR;
+       }
+
        data->raw_sms->status = message[4];

        /* Check UDHI */


-- 
*** Osma Suominen *** address@hidden *** http://www.iki.fi/ozone/ ***




reply via email to

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