Huge thanks to our Platinum Members Endace and LiveAction,
and our Silver Member Veeam, for supporting the Wireshark Foundation and project.

Ethereal-dev: [Ethereal-dev] Array subscript out of range in gsm_map_stat.c

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: "d binderman" <dcb314@xxxxxxxxxxx>
Date: Tue, 05 Jul 2005 22:12:58 +0000
Hello there,

I just tried to compile Redhat Fedora package ethereal-0.10.11-3 with
the Intel C compiler version 8.1

The compiler said

gsm_map_stat.c(443): warning #175: subscript out of range

The source code is

       dlg.entries[10] = g_strdup("0");

but

typedef struct _gsm_map_stat_dlg_t {
   GtkWidget           *win;
   GtkWidget           *scrolled_win;
   GtkWidget           *table;
   char                *entries[GSM_MAP_INIT_TABLE_NUM_COLUMNS];
} gsm_map_stat_dlg_t;

and

#define GSM_MAP_INIT_TABLE_NUM_COLUMNS          10

So it should be clear that dlg.entries[10] does not exist.

I'm not sure what the fix is for this. Maybe increasing the size of
the entries array would help.

Regards

David Binderman

_________________________________________________________________
Winks & nudges are here - download MSN Messenger 7.0 today! http://messenger.msn.co.uk