Text  |   XML   |   Visible Warnings:

irssi-0.8.14 : irssi-0.8.14 analysis 2 : Null Pointer Dereference  at modes.c:446

Categories: LANG.MEM.NPD CWE:476
Warning ID: 7249.28331
Procedure: modes_join
Trace: view
Modified: Thu Nov 26 11:08: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
   /kat0/fletcher/SATE/2010/irssi-0.8.14/src/irc/core/modes.c
   Enter modes_join
 415 char *modes_join(IRC_SERVER_REC *server, const char *old,
 416                  const char *mode, int channel) 
 417 {
 418         GString *newmode;
 419         char *dup, *modestr, *curmode, type;
 420  
 421         g_return_val_if_fail(mode != NULL, NULL);
 422  
 423         type = '+';
true424         newmode = g_string_new(old);
 425  
 426         dup = modestr = g_strdup(mode);
 427         curmode = cmd_get_param(&modestr);
 428         while (*curmode != '\0' && *curmode != ' ') {   /* Null Pointer Dereference (ID: 7250.28332) */
 429                 if (*curmode == '+' || *curmode == '-') {
 430                         type = *curmode;
 431                         curmode++;
 432                         continue;
 433                 }
 434  
 435                 if (!channel || !HAS_MODE_ARG(server, type, *curmode))   /* Null Pointer Dereference (ID: 7381.28479) */
newmode = 0436                         mode_set(server, newmode, type, *curmode, !channel);
 437                 else {
 438                         mode_set_arg(server, newmode, type, *curmode,
 439                                      cmd_get_param(&modestr), !channel);
 440                 }
 441  
 442                 curmode++;
 443         }
 444         g_free(dup);
 445  
newmode <= 4095446         modestr = newmode->str;     /* Null Pointer Dereference */
Preconditions
mode != 0
channel != 0
$unknown_279468 != 0
$unknown_279468 != 32
$unknown_279468 != 43
$unknown_279468 != 45
strlen(&$unknown_279468) = 1
((char*)&$unknown_279468)[1] = 0
Postconditions
_g_boolean_var_' = 1
curmode' = &$unknown_279468 + 1
dup' = &$unknown_279468
modestr' = &$unknown_279468 + 1
newmode' = 0
type' = 43




Change Warning 7249.28331 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: