Index: common/gsm-sms.c =================================================================== RCS file: /sources/gnokii/gnokii/common/gsm-sms.c,v retrieving revision 1.159 diff -u -p -r1.159 gsm-sms.c --- common/gsm-sms.c 6 Jan 2007 22:53:21 -0000 1.159 +++ common/gsm-sms.c 3 Jul 2007 23:24:41 -0000 @@ -747,6 +747,8 @@ GNOKII_API gn_error gn_sms_get(gn_data * gn_sms_raw rawsms; if (!data->sms) return GN_ERR_INTERNALERROR; + if (data->sms->number < 1) return GN_ERR_EMPTYLOCATION; + if (data->sms->memory_type > GN_MT_LAST) return GN_ERR_INVALIDMEMORYTYPE; memset(&rawsms, 0, sizeof(gn_sms_raw)); rawsms.number = data->sms->number; rawsms.memory_type = data->sms->memory_type; Index: include/gnokii/common.h =================================================================== RCS file: /sources/gnokii/gnokii/include/gnokii/common.h,v retrieving revision 1.152 diff -u -p -r1.152 common.h --- include/gnokii/common.h 4 May 2007 19:41:34 -0000 1.152 +++ include/gnokii/common.h 3 Jul 2007 23:24:46 -0000 @@ -102,6 +102,7 @@ typedef enum { GN_MT_F18, GN_MT_F19, GN_MT_F20, /* 20th CUSTOM FOLDER */ + GN_MT_LAST = GN_MT_F20, GN_MT_XX = 0xff /* Error code for unknown memory type (returned by fbus-xxxx functions). */ } gn_memory_type;