Text  |   XML   |   Visible Warnings:

irssi-0.8.14 : irssi-0.8.14 analysis 2 : Null Pointer Dereference  at dcc.c:228

Categories: LANG.MEM.NPD CWE:476
Warning ID: 7259.28343
Procedure: dcc_listen
Trace: view
Modified: Thu Nov 26 11:08:57 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/dcc/dcc.c
   Enter dcc_listen
 197 GIOChannel *dcc_listen(GIOChannel *iface, IPADDR *ip, int *port) 
 198 {
 199         GIOChannel *handle;
 200         IPADDR *listen_ip = NULL;
 201         const char *dcc_port, *p, *own_ip;
 202         int first, last;
 203  
 204         if (net_getsockname(iface, ip, NULL) == -1)
 205                 return NULL;
 206  
 207         /* figure out if we want to listen in IPv4 address or in "any" address,
 208            which may mean IPv4+IPv6 or just IPv6 depending on OS. */ 
 209         own_ip = settings_get_str("dcc_own_ip");
 210         if (*own_ip != '\0') {   /* Null Pointer Dereference (ID: 7260.28344) */
 211                 if (is_ipv4_address(own_ip))
 212                         listen_ip = &ip4_any;
 213         } else {
 214                 if (!IPADDR_IS_V6(ip))
 215                         listen_ip = &ip4_any;
 216         }
 217  
 218         /* get first port */ 
true219         dcc_port = settings_get_str("dcc_port");
 220         first = atoi(dcc_port);
 221         if (first == 0) {
 222                 /* random port */ 
 223                 *port = 0;
 224                 return net_listen(listen_ip, port);
 225         }
 226  
 227         /* get last port */ 
dcc_port <= 4095228         p = strchr(dcc_port, ' ');     /* Null Pointer Dereference */
Preconditions
iface != 0
&$unknown_298526 != 10
&$unknown_298528 != 0
$unknown_298527 != 0
strlen(&$unknown_298527) != 0
$input_12 = &$unknown_298528
Postconditions
dcc_port' = 0
first' = &$unknown_298528
listen_ip' = &ip4_any.family
own_ip' = &$unknown_298527




Change Warning 7259.28343 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: