Text  |   XML   |   Visible Warnings:

Irssi : Irssi analysis 1 : Null Pointer Dereference  at bans.c:69

Categories: LANG.MEM.NPD CWE:476
Warning ID: 2152.2155
Procedure: ban_get_mask
Trace: View
Modified: Wed Sep 2 11:51:35 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/bans.c
   Enter ban_get_mask
 44 char *ban_get_mask(IRC_CHANNEL_REC *channel, const char *nick, int ban_type) 
 45 {
 46         NICK_REC *rec;
 47         char *str, *user, *host;
 48         int size;
 49  
 50         g_return_val_if_fail(IS_IRC_CHANNEL(channel), NULL);
 51         g_return_val_if_fail(nick != NULL, NULL);
 52  
 53         rec = nicklist_find(CHANNEL(channel), nick);
 54         if (rec == NULL) return NULL;
 55         if (rec->host == NULL) {
 56                 g_warning("channel %s is not synced, using nick ban for %s", channel->name, nick);
 57                 return g_strdup_printf("%s!*@*", nick);
 58         }
 59  
 60         if (ban_type <= 0)
 61                 ban_type = default_ban_type;
 62  
true63         str = irc_get_mask(nick, rec->host, ban_type);
 64  
 65         /* there's a limit of 10 characters in user mask. so, banning 
 66            someone with user mask of 10 characters gives us "*1234567890",
 67            which is one too much.. so, remove the first character after "*"
 68            so we'll get "*234567890" */ 
str <= 409569         user = strchr(str, '!');     /* Null Pointer Dereference */
Preconditions
$param_2 != 0
$param_3 <= 0
((char*)$unknown_253312)[24] != 126
((char*)$unknown_253312)[24] != 43
((char*)$unknown_253312)[24] != 45
((char*)$unknown_253312)[24] != 61
((char*)$unknown_253312)[24] != 94
Postconditions
_g_boolean_var_' = 1
_g_boolean_var_' = 1
ban_type' = default_ban_type
channel' = $param_1
nick' = $param_2
rec' = &$unknown_253312
str' = 0




Change Warning 2152.2155 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: