Text  |   XML   |   Visible Warnings:

irssi-0.8.14 : irssi-0.8.14 analysis 2 : Null Pointer Dereference  at nicklist.c:441

Categories: LANG.MEM.NPD CWE:476
Warning ID: 7243.28325
Procedure: nicklist_set_own
Trace: view
Modified: Thu Nov 26 11:08:45 2009   show details
 
Priority: None
State: None
Finding: None
Owner: None
  edit properties

Legend [ X ]
Warning Location
Contributes
Parse Error
Other Warning
Two or More Loop Iterations
On Execution Path
Comment
Macro
Preprocessor
Include
Keyword
Preprocessed Away

Source  |  Language: C Hide Legend     
ProblemLineSource
   /kat0/fletcher/SATE/2010/irssi-0.8.14/src/irc/core/irc-nicklist.c
   Enter event_end_of_names
 170 static void event_end_of_names(IRC_SERVER_REC *server, const char *data) 
 171 {
 172         char *params, *channel;
 173         IRC_CHANNEL_REC *chanrec;
 174         NICK_REC *ownnick;
 175         int nicks;
 176          
 177         g_return_if_fail(server != NULL);
 178  
 179         params = event_get_params(data, 2, NULL, &channel);
 180  
 181         chanrec = irc_channel_find(server, channel);
 182         if (chanrec != NULL && !chanrec->names_got) {
 183                 ownnick = nicklist_find(CHANNEL(chanrec), server->nick);
 184                 if (ownnick == NULL) {
 185                         /* stupid server - assume we have ops 
 186                            if channel is empty */ 
 187                         nicks = g_hash_table_size(chanrec->nicks);
 188                         ownnick = irc_nicklist_insert(chanrec, server->nick,
 189                                                       nicks == 0, FALSE,
true190                                                       FALSE, FALSE);
 191                 }
ownnick <= 4095192                 nicklist_set_own(CHANNEL(chanrec), ownnick);
     /kat0/fletcher/SATE/2010/irssi-0.8.14/src/core/nicklist.c
     Enter event_end_of_names / nicklist_set_own
 433   void nicklist_set_own(CHANNEL_REC *channel, NICK_REC *nick) 
 434   {
 435           NICK_REC *first, *next;
 436    
 437           channel->ownnick = nick;   /* Null Pointer Dereference (ID: 7242.28324) */
 438    
 439           /* move our nick in the list to first, makes some things easier 
 440              (like handling multiple identical nicks in fe-messages.c) */ 
nick <= 4095441           first = g_hash_table_lookup(channel->nicks, nick->nick);     /* Null Pointer Dereference */
     Exit event_end_of_names / nicklist_set_own
Preconditions
nick = 0
&$unknown_250984 != 0
&$unknown_250986 != 0
((char*)&$unknown_250985)[84] = 0
Postconditions
_g_boolean_var_' = 1
((char*)&$unknown_250985)[64]' = 0
channel' = &$unknown_250984
channel' = &$unknown_250985
chanrec' = &$unknown_250985
nick' = 0
nicks' = &$unknown_250986
ownnick' = 0
params' = 0




Change Warning 7243.28325 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: