Text   |  XML   |  ReML   |   Visible Warnings:

Uninitialized Variable  at capture_sync.c:1233

No properties have been set. | edit properties
Jump to warning location ↓ warning details...
Show Events | Options

sync_pipe_input_cb

(/home/sate/Testcases/c/cve/wireshark-1.2.0/capture_sync.c)expand/collapse
Show more  
 1154  sync_pipe_input_cb(gint source, gpointer user_data)
 1155  {
 1156    capture_options *capture_opts = (capture_options *)user_data;
 1157    char buffer[SP_MAX_MSG_LEN+1];
 1158    int  nread;
 1159    char indicator;
 1160    int  primary_len;
 1161    char * primary_msg;
 1162    int  secondary_len;
 1163    char * secondary_msg;
 1164   
 1165   
 1166[+]   nread = pipe_read_block(source, &indicator, SP_MAX_MSG_LEN, buffer);
 1167    if(nread <= 0) {
 1168      if (nread == 0)
 1169        g_log(LOG_DOMAIN_CAPTURE, G_LOG_LEVEL_DEBUG,
 1170              "sync_pipe_input_cb: child has closed sync_pipe");
 1171      else 
 1172        g_log(LOG_DOMAIN_CAPTURE, G_LOG_LEVEL_DEBUG,
 1173              "sync_pipe_input_cb: error reading from sync pipe");
 1174   
 1175      /* The child has closed the sync pipe, meaning it's not going to be
 1176         capturing any more packets.  Pick up its exit status, and 
 1177         complain if it did anything other than exit with status 0.
 1178   
 1179         We don't have to worry about killing the child, if the sync pipe
 1180         returned an error. Usually this error is caused as the child killed itself
 1181         while going down. Even in the rare cases that this isn't the case,
 1182         the child will get an error when writing to the broken pipe the next time,
 1183         cleaning itself up then. */
 1184      sync_pipe_wait_for_child(capture_opts);
 1185   
 1186  #ifdef _WIN32 
 1187      ws_close(capture_opts->signal_pipe_write_fd);
 1188  #endif
 1189      capture_input_closed(capture_opts);
 1190      return FALSE;
 1191    }
 1192   
 1193    /* we got a valid message block from the child, process it */
 1194    switch(indicator) {
 1195    case SP_FILE:
 1196      if(!capture_input_new_file(capture_opts, buffer)) {
 1197        g_log(LOG_DOMAIN_CAPTURE, G_LOG_LEVEL_DEBUG, "sync_pipe_input_cb: file failed, closing capture");
 1198   
 1199        /* We weren't able to open the new capture file; user has been 
 1200           alerted. Close the sync pipe. */
 1201        ws_close(source);
 1202   
 1203        /* the child has send us a filename which we couldn't open.
 1204           this probably means, the child is creating files faster than we can handle it.
 1205
1221
Show [ Lines 1205 to 1221 omitted. ]
 1222      secondary_msg = primary_msg + primary_len + 4;
 1223      /* message output */
 1224      capture_input_error_message(capture_opts, primary_msg, secondary_msg);
 1225      /* the capture child will close the sync_pipe, nothing to do for now */
 1226      /* (an error message doesn't mean we have to stop capturing) */
 1227      break;
 1228    case SP_BAD_FILTER:
 1229      capture_input_cfilter_error_message(capture_opts, buffer);
 1230      /* the capture child will close the sync_pipe, nothing to do for now */
 1231      break;
 1232    case SP_DROPS:
 1233      capture_input_drops(capture_opts, (guint32)strtoul(buffer, NULL, 10));
Show more  




Change Warning 4894.31805 : Uninitialized Variable

Priority:
State:
Finding:
Owner:
Note: