Text  |   XML   |   Visible Warnings:

Irssi : Irssi analysis 1 : Null Pointer Dereference  at modes.c:618

Categories: LANG.MEM.NPD CWE:476
Warning ID: 2186.2191
Procedure: channel_set_mode
Trace: View
Modified: Wed Sep 2 11:51:54 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/modes.c
   Enter channel_set_mode
 594 void channel_set_mode(IRC_SERVER_REC *server, const char *channel,
 595                       const char *mode) 
 596 {
 597         IRC_CHANNEL_REC *chanrec;
 598         GString *tmode, *targs;
 599         char *modestr, *curmode, *orig, type, prevtype;
 600         int count;
 601  
 602         g_return_if_fail(IS_IRC_SERVER(server));
 603         g_return_if_fail(channel != NULL && mode != NULL);
 604  
 605         tmode = g_string_new(NULL);
 606         targs = g_string_new(NULL);
 607         count = 0;
 608  
 609         chanrec = irc_channel_find(server, channel);
 610         if (chanrec != NULL)
 611                 channel = chanrec->name;
 612  
 613         orig = modestr = g_strdup(mode);
 614  
 615         type = '+'; prevtype = '\0';
true616         curmode = cmd_get_param(&modestr);
 617         for (;; curmode++) {
curmode <= 4095618                 if (*curmode == '\0') {     /* Null Pointer Dereference */
Preconditions
$param_2 != 0
$param_3 != 0
Postconditions
_g_boolean_var_' = 1
_g_boolean_var_' = 1
channel' = $param_2
chanrec' = 0
count' = 0
curmode' = 0
mode' = $param_3
modestr' = 0
orig' = 0
prevtype' = 0
server' = $param_1
type' = 43




Change Warning 2186.2191 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: