Text   |  XML   |  ReML   |   Visible Warnings:

Unreachable Data Flow  at ngsniffer.c:1273

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

ngsniffer_seek_read

(/home/sate/Testcases/c/cve/wireshark-1.2.0/wiretap/ngsniffer.c)expand/collapse
Show more  
 1207  static gboolean ngsniffer_seek_read(wtap *wth, gint64 seek_off,
 1208      union wtap_pseudo_header *pseudo_header, guchar *pd, int packet_size,
 1209      int *err, gchar **err_info _U_)
 1210  {
 1211          int     ret;
 1212          guint16 type, length;
 1213          struct frame2_rec frame2;
 1214          struct frame4_rec frame4;
 1215          struct frame6_rec frame6;
 1216   
 1217          if (ng_file_seek_rand(wth, seek_off, SEEK_SET, err) == -1)
 1218                  return FALSE;
 1219   
 1220          ret = ngsniffer_read_rec_header(wth, TRUE, &type, &length, err);
 1221          if (ret <= 0) {
 1222                  /* Read error or EOF */
 1223                  if (ret == 0) {
 1224                          /* EOF means "short read" in random-access mode */
 1225                          *err = WTAP_ERR_SHORT_READ;
 1226                  }
 1227                  return FALSE;
 1228          }
 1229   
 1230          switch (type) {
 1231   
 1232          case REC_FRAME2:
 1233                  /* Read the f_frame2_struct */
 1234                  if (!ngsniffer_read_frame2(wth, TRUE, &frame2, err)) {
 1235                          /* Read error */
 1236                          return FALSE;
 1237                  }
 1238   
 1239                  length -= sizeof frame2;        /* we already read that much */
 1240   
 1241                  set_pseudo_header_frame2(wth, pseudo_header, &frame2);
 1242                  break;
 1243   
 1244          case REC_FRAME4:
 1245                  /* Read the f_frame4_struct */
 1246                  if (!ngsniffer_read_frame4(wth, TRUE, &frame4, err)) {
 1247                          /* Read error */
 1248                          return FALSE;
 1249                  }
 1250   
 1251                  length -= sizeof frame4;        /* we already read that much */
 1252   
 1253                  set_pseudo_header_frame4(pseudo_header, &frame4);
 1254                  break;
 1255   
 1256          case REC_FRAME6:
 1257                  /* Read the f_frame6_struct */
 1258                  if (!ngsniffer_read_frame6(wth, TRUE, &frame6, err)) {
 1259                          /* Read error */
 1260                          return FALSE;
 1261                  }
 1262   
 1263                  length -= sizeof frame6;        /* we already read that much */
 1264   
 1265                  set_pseudo_header_frame6(wth, pseudo_header, &frame6);
 1266                  break;
 1267   
 1268          default:
 1269                  /*
 1270                   * "Can't happen".
 1271                   */
 1272                  g_assert_not_reached();
 1273                  return FALSE;
 1274          }
 1275   
 1276          /*
 1277           * Got the pseudo-header (if any), now get the data.
 1278           */
 1279          if (!ngsniffer_read_rec_data(wth, TRUE, pd, packet_size, err))
 1280                  return FALSE;
 1281   
 1282          fix_pseudo_header(wth->file_encap, pd, packet_size, pseudo_header);
 1283   
 1284          return TRUE;
 1285  }
Show more  




Change Warning 1039.30248 : Unreachable Data Flow

Priority:
State:
Finding:
Owner:
Note: