Text  |   XML   |   Visible Warnings:

irssi-0.8.14 : irssi-0.8.14 analysis 2 : Null Pointer Dereference  at chat-commands.c:79

Categories: LANG.MEM.NPD CWE:476
Warning ID: 4791.28242
Procedure: get_server_connect
Trace: view
Modified: Thu Nov 26 11:08:14 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/core/chat-commands.c
   Enter get_server_connect
 37 static SERVER_CONNECT_REC *get_server_connect(const char *data, int *plus_addr,
 38                                               char **rawlog_file) 
 39 {
 40         CHAT_PROTOCOL_REC *proto;
 41         SERVER_CONNECT_REC *conn;
 42         GHashTable *optlist;
 43         char *addr, *portstr, *password, *nick, *chatnet, *host, *tmp;
 44         void *free_arg;
 45  
 46         g_return_val_if_fail(data != NULL, NULL);
 47  
 48         if (!cmd_get_params(data, &free_arg, 4 | PARAM_FLAG_OPTIONS,
 49                             "connect", &optlist, &addr, &portstr,
 50                             &password, &nick))
 51                 return NULL;
 52         if (plus_addr != NULL) *plus_addr = *addr == '+';
 53         if (*addr == '+') addr++;
 54         if (*addr == '\0') {
 55                 signal_emit("error command", 1,
 56                             GINT_TO_POINTER(CMDERR_NOT_ENOUGH_PARAMS));
 57                 cmd_params_free(free_arg);
 58                 return NULL;
 59         }
 60  
 61         if (strcmp(password, "-") == 0)
 62                 *password = '\0';
 63  
 64         /* check if -<chatnet> option is used to specify chat protocol */ 
 65         proto = chat_protocol_find_net(optlist);
 66  
 67         /* connect to server */ 
 68         chatnet = proto == NULL ? NULL : 
 69                 g_hash_table_lookup(optlist, proto->chatnet);
 70  
 71         if (chatnet == NULL)
 72                 chatnet = g_hash_table_lookup(optlist, "network");
 73  
 74         conn = server_create_conn(proto != NULL ? proto->id : -1, addr,
 75                                   atoi(portstr), chatnet, password, nick);
 76         if (proto == NULL)
true77                 proto = chat_protocol_find_id(conn->chat_type);
 78  
proto <= 409579         if (proto->not_initialized) {     /* Null Pointer Dereference */
Preconditions
data != 0
&$unknown_40248 != 0
$unknown_40246 = 43
strlen(&$unknown_40246) != 0
strlen(&$unknown_40246) != 1
((char*)&$unknown_40246)[1] != 0
((char*)&$unknown_40251)[4] >= 1
chat_protocols = 0
chatnets >= 0
Postconditions
_g_boolean_var_' = 1
addr' = &$unknown_40246 + 1
strlen(&$unknown_40247)' = 0
conn' = &$unknown_40251
nick' >= 0
optlist' = &$unknown_40248
password' = &$unknown_40247
proto' = 0




Change Warning 4791.28242 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: