Text  |   XML   |   Visible Warnings:

Irssi : Irssi analysis 1 : Unreachable Call  at net-nonblock.c:178

Categories: LANG.STRUCT.UC CWE:561
Warning ID: 2123.2124
Procedure: net_gethostbyname_return
Trace: View
Modified: Wed Sep 2 11:51:22 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     
LineSource
  /u1/paul/SATE/2010/c/irssi/irssi-0.8.14/src/core/net-nonblock.c
  Enter net_gethostbyname_return
152 int net_gethostbyname_return(GIOChannel *pipe, RESOLVED_IP_REC *rec) 
153 {
154         int len;
155  
156         rec->error = -1;
157         rec->errorstr = NULL;
158         rec->host4 = NULL;
159         rec->host6 = NULL;
160  
161 #ifndef WIN32 
162         fcntl(g_io_channel_unix_get_fd(pipe), F_SETFL, O_NONBLOCK);
163 #endif 
164  
165         /* get ip+error */ 
166         if (g_io_channel_read_block(pipe, rec, sizeof(*rec)) == -1) {
167                 rec->errorstr = g_strdup_printf("Host name lookup: %s",
168                                                 g_strerror(errno));
169                 return -1;
170         }
171  
172         if (rec->error) {   /* Redundant Condition (ID: 2122.2123) */
173                 /* read error string, if we can't read everything for some 
174                    reason, just ignore it. */ 
175                 rec->errorstr = g_malloc0(rec->errlen+1);
176                 g_io_channel_read_block(pipe, rec->errorstr, rec->errlen);
177         } else {
178                 if (rec->host4) {     /* Unreachable Call */
179                         g_io_channel_read_block(pipe, &len, sizeof(int));
180                         rec->host4 = g_malloc0(len);
181                         g_io_channel_read_block(pipe, rec->host4, len);
182                 }
183                 if (rec->host6) {
184                         g_io_channel_read_block(pipe, &len, sizeof(int));
185                         rec->host6 = g_malloc0(len);
186                         g_io_channel_read_block(pipe, rec->host6, len);
187                 }
188         }
189  
190         return 0;
191 




Change Warning 2123.2124 : Unreachable Call

Priority:
State:
Finding:
Owner:
Note: