Text   |  XML   |  ReML   |   Visible Warnings:

Unused Value  at capture_sync.c:1129

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

pipe_read_block

(/home/sate/Testcases/c/cve/wireshark-1.2.0/capture_sync.c)expand/collapse
Show more  
 1097  pipe_read_block(int pipe, char *indicator, int len, char *msg) {
 1098      int required;
 1099      int newly;
 1100      guchar header[4];
 1101   
 1102   
 1103      /* read header (indicator and 3-byte length) */
 1104      newly = pipe_read_bytes(pipe, header, 4);
 1105      if(newly != 4) {
 1106          g_log(LOG_DOMAIN_CAPTURE, G_LOG_LEVEL_DEBUG,
 1107                "read %d failed to read header: %u", pipe, newly);
 1108          return -1;
 1109      }
 1110   
 1111      /* convert header values */
 1112      pipe_convert_header(header, 4, indicator, &required);
 1113   
 1114      /* only indicator with no value? */
 1115      if(required == 0) {
 1116          g_log(LOG_DOMAIN_CAPTURE, G_LOG_LEVEL_DEBUG,
 1117                "read %d indicator: %c empty value", pipe, *indicator);
 1118          return 4;
 1119      }
 1120   
 1121      /* does the data fit into the given buffer? */
 1122      if(required > len) {
 1123          g_log(LOG_DOMAIN_CAPTURE, G_LOG_LEVEL_DEBUG,
 1124                "read %d length error, required %d > len %d, indicator: %u",
 1125                pipe, required, len, *indicator);
 1126   
 1127          /* we have a problem here, try to read some more bytes from the pipe to debug where the problem really is */
 1128          memcpy(msg, header, sizeof(header));
 1129          newly = read(pipe, &msg[sizeof(header)], len-sizeof(header));
 1130          g_warning("Unknown message from dumpcap, try to show it as a string: %s", msg);
 1131          return -1;
 1132      }
 1133      len = required;
 1134   
 1135      /* read the actual block data */
 1136      newly = pipe_read_bytes(pipe, msg, required);
 1137      if(newly != required) {
 1138          g_warning("Unknown message from dumpcap, try to show it as a string: %s", msg);
 1139          return -1;
 1140      }
 1141   
 1142      /* XXX If message is "2part", the msg probably won't be sent to debug log correctly */
 1143      g_log(LOG_DOMAIN_CAPTURE, G_LOG_LEVEL_DEBUG,
 1144            "read %d ok indicator: %c len: %u msg: %s", pipe, *indicator,
 1145            len, msg);
 1146      return newly + 4;
 1147  }
Show more  




Change Warning 4882.30172 : Unused Value

Priority:
State:
Finding:
Owner:
Note: