Text  |   XML   |   Visible Warnings:

irssi-0.8.14 : irssi-0.8.14 analysis 2 : Null Pointer Dereference  at bans.c:69

Categories: LANG.MEM.NPD CWE:476
Warning ID: 6619.28296
Procedure: ban_get_mask
Trace: view
Modified: Thu Nov 26 11:08:33 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/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
nick != 0
ban_type <= 0
((char*)$unknown_141663)[16] != 126
((char*)$unknown_141663)[16] != 43
((char*)$unknown_141663)[16] != 45
((char*)$unknown_141663)[16] != 61
((char*)$unknown_141663)[16] != 94
$unknown_141664 != 64
Postconditions
_g_boolean_var_' = 1
_g_boolean_var_' = 1
ban_type' = default_ban_type
rec' = &$unknown_141663
str' = 0




Change Warning 6619.28296 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: