Text  |   XML   |   Visible Warnings:

Irssi : Irssi analysis 1 : Null Pointer Dereference  at massjoin.c:77

Categories: LANG.MEM.NPD CWE:476
Warning ID: 2182.2187
Procedure: event_join
Trace: View
Modified: Wed Sep 2 11:51:49 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
   /u1/paul/SATE/2010/c/irssi/irssi-0.8.14/src/irc/core/massjoin.c
   Enter event_join
 35 static void event_join(IRC_SERVER_REC *server, const char *data,
 36                        const char *nick, const char *address) 
 37 {
 38         char *params, *channel, *ptr;
 39         IRC_CHANNEL_REC *chanrec;
 40         NICK_REC *nickrec;
 41         GSList *nicks, *tmp;
 42  
 43         g_return_if_fail(data != NULL);
 44  
 45         if (g_strcasecmp(nick, server->nick) == 0) {
 46                 /* You joined, no need to do anything here */ 
 47                 return;
 48         }
 49  
 50         params = event_get_params(data, 1, &channel);
 51         ptr = strchr(channel, 7); /* ^G does something weird.. */ 
 52         if (ptr != NULL) *ptr = '\0';
 53  
 54         /* find channel */ 
 55         chanrec = irc_channel_find(server, channel);
 56         g_free(params);
 57         if (chanrec == NULL) return;
 58  
 59         /* check that the nick isn't already in nicklist. seems to happen 
 60            sometimes (server desyncs or something?) */ 
 61         nickrec = nicklist_find(CHANNEL(chanrec), nick);
 62         if (nickrec != NULL) {
 63                 /* destroy the old record */ 
 64                 nicklist_remove(CHANNEL(chanrec), nickrec);
 65         }
 66  
 67         /* add user to nicklist */ 
true68         nickrec = irc_nicklist_insert(chanrec, nick, FALSE, FALSE, FALSE, TRUE);
 69         nicklist_set_host(CHANNEL(chanrec), nickrec, address);
 70  
 71         if (chanrec->massjoins == 0) {
 72                 /* no nicks waiting in massjoin queue */ 
 73                 chanrec->massjoin_start = time(NULL);
 74                 chanrec->last_massjoins = 0;
 75         }
 76  
nickrec <= 409577         if (nickrec->realname == NULL) {     /* Null Pointer Dereference */
Preconditions
$param_2 != 0
$param_3 != 0
&$unknown_454301 != 0
&$unknown_454306 != 0
((char*)&$unknown_454305)[192] = 0
Postconditions
_g_boolean_var_' = 1
address' = $param_4
$unknown_454303' = 0
strlen(&$unknown_454303)' = 0
((char*)&$unknown_454305)[196]' = 0
channel' = &$unknown_454302
chanrec' = &$unknown_454305
data' = $param_2
nick' = $param_3
nickrec' = 0
params' = &$unknown_454304
ptr' = &$unknown_454303
server' = $param_1




Change Warning 2182.2187 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: