Text   |  XML   |  ReML   |   Visible Warnings:

Unreachable Call  at pcapio.c:285

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

libpcap_write_session_header_block

(/home/sate/Testcases/c/cve/wireshark-1.2.0/pcapio.c)expand/collapse
Show more  
 271  libpcap_write_session_header_block(FILE *fp,
 272                                     char *appname,
 273                                     long *bytes_written,
 274                                     int *err)
 275  {
 276          struct shb shb;
 277          struct option option;
 278          guint32 block_total_length;
 279          const guint32 padding = 0;
 280           
 281          block_total_length = sizeof(struct shb) +
 282                               sizeof(guint32);
 283          if ((strlen(appname) > 0) && (strlen(appname) < G_MAXUINT16)) {
 284                  block_total_length += 2 * sizeof(struct option) +
 285                                        (guint16)(ADD_PADDING(strlen(appname) + 1));
 286          }
 287          /* write shb header */
 288          shb.block_type = SECTION_HEADER_BLOCK_TYPE;
 289          shb.block_total_length = block_total_length;
 290          shb.byte_order_magic = PCAPNG_MAGIC;
 291          shb.major_version = PCAPNG_MAJOR_VERSION;
 292          shb.minor_version = PCAPNG_MINOR_VERSION;
 293          shb.section_length = -1;
 294          WRITE_DATA(fp, &shb, sizeof(struct shb), *bytes_written, err);
 295   
 296          if ((strlen(appname) > 0) && (strlen(appname) < G_MAXUINT16)) {
 297                  /* write shb_userappl options */
 298                  option.type = SHB_USERAPPL;
 299                  option.value_length = (guint16)(strlen(appname) + 1);
 300                  WRITE_DATA(fp, &option, sizeof(struct option), *bytes_written, err);
 301                  WRITE_DATA(fp, appname, strlen(appname) + 1, *bytes_written, err);
 302                  if ((strlen(appname) + 1) % 4) {
 303                          WRITE_DATA(fp, &padding, 4 - (strlen(appname) + 1) % 4, *bytes_written, err);
 304                  }
 305                  /* write last option */
 306                  option.type = OPT_ENDOFOPT;
 307                  option.value_length = 0;
 308                  WRITE_DATA(fp, &option, sizeof(struct option), *bytes_written, err);
 309          }
 310          /* write the trailing block total length */
 311          WRITE_DATA(fp, &block_total_length, sizeof(guint32), *bytes_written, err);
 312          return TRUE;
 313  }
Show more  




Change Warning 5011.29770 : Unreachable Call

Priority:
State:
Finding:
Owner:
Note: