Text   |  XML   |  ReML   |   Visible Warnings:

Uninitialized Variable  at capture_sync.c:1089

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           this should only be the case for very fast file switches
 1206           we can't do much more than telling the child to stop 
 1207           (this is the "emergency brake" if user e.g. wants to switch files every second) */
 1208        sync_pipe_stop(capture_opts);
 1209      }
 1210      break;
 1211    case SP_PACKET_COUNT:
 1212      nread = atoi(buffer);
 1213      g_log(LOG_DOMAIN_CAPTURE, G_LOG_LEVEL_DEBUG, "sync_pipe_input_cb: new packets %u", nread);
 1214      capture_input_new_packets(capture_opts, nread);
 1215      break;
 1216    case SP_ERROR_MSG:
 1217      /* convert primary message */
 1218[+]     pipe_convert_header(buffer, 4, &indicator, &primary_len);
expand/collapse

pipe_convert_header

(/home/sate/Testcases/c/cve/wireshark-1.2.0/capture_sync.c)expand/collapse
Show more  
 1084  pipe_convert_header(const guchar *header, int header_len, char *indicator, int *block_len) {
 1085   
 1086      g_assert(header_len == 4);
 1087   
 1088      /* convert header values */
 1089      *indicator = header[0];
Show more  
Show more  




Change Warning 4895.31806 : Uninitialized Variable

Priority:
State:
Finding:
Owner:
Note: