Text   |  XML   |  ReML   |   Visible Warnings:

Useless Assignment  at ngsniffer.c:2544

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

read_blob

(/home/sate/Testcases/c/cve/wireshark-1.2.0/wiretap/ngsniffer.c)expand/collapse
Show more  
 2513  read_blob(FILE_T infile, ngsniffer_comp_stream_t *comp_stream, int *err)
 2514  {
 2515      int in_len;
 2516      size_t read_len;
 2517      unsigned short blob_len;
 2518      gint16 blob_len_host;
 2519      gboolean uncompressed;
 2520      unsigned char file_inbuf[65536];
 2521      int out_len;
 2522   
 2523      /* Read one 16-bit word which is length of next compressed blob */
 2524      errno = WTAP_ERR_CANT_READ;
 2525      read_len = file_read(&blob_len, 1, 2, infile);
 2526      if (2 != read_len) {
 2527          *err = file_error(infile);
 2528          return -1;
 2529      }
 2530      comp_stream->comp_offset += 2;
 2531      blob_len_host = pletohs(&blob_len);
 2532   
 2533      /* Compressed or uncompressed? */
 2534      if (blob_len_host < 0) {
 2535          /* Uncompressed blob; blob length is absolute value of the number. */
 2536          in_len = -blob_len_host;
 2537          uncompressed = TRUE;
 2538      } else {
 2539          in_len = blob_len_host;
 2540          uncompressed = FALSE;
 2541      }
 2542   
 2543      /* Read the blob */
 2544      errno = WTAP_ERR_CANT_READ;
 2545      read_len = file_read(file_inbuf, 1, in_len, infile);
 2546      if ((size_t) in_len != read_len) {
 2547          *err = file_error(infile);
 2548          return -1;
 2549      }
 2550      comp_stream->comp_offset += in_len;
 2551   
 2552      if (uncompressed) {
 2553          memcpy(comp_stream->buf, file_inbuf, in_len);
 2554          out_len = in_len;
 2555      } else {
 2556          /* Decompress the blob */
 2557          out_len = SnifferDecompress(file_inbuf, in_len,
 2558                                  comp_stream->buf, OUTBUF_SIZE, err);
 2559          if (out_len < 0)
 2560              return -1;
 2561      }
 2562      comp_stream->nextout = 0;
 2563      comp_stream->nbytes = out_len;
 2564      return 0;
 2565  }
Show more  




Change Warning 1031.29752 : Useless Assignment

Priority:
State:
Finding:
Owner:
Note: