Text   |  XML   |  ReML   |   Visible Warnings:

Buffer Overrun  at charsets.c:136

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

follow_read_tcp_stream

(/home/sate/Testcases/c/cve/wireshark-1.2.0/gtk/follow_tcp.c)expand/collapse
Show more  
 329  follow_read_tcp_stream(follow_info_t *follow_info,
 330                         gboolean (*print_line)(char *, size_t, gboolean, void *),
 331                         void *arg)
 332  {
 333      tcp_stream_chunk    sc;
 334      int                 bcount, iplen;
 335      guint8              client_addr[MAX_IPADDR_LEN];
 336      guint16             client_port = 0;
 337      gboolean            is_server;
 338      guint32             global_client_pos = 0, global_server_pos = 0;
 339      guint32             server_packet_count = 0;
 340      guint32             client_packet_count = 0;
 341      guint32             *global_pos;
 342      gboolean            skip;
 343      char                buffer[FLT_BUF_SIZE+1]; /* +1 to fix ws bug 1043 */
 344      size_t              nchars;
 345      frs_return_t        frs_return;
 346   
 347      iplen = (follow_info->is_ipv6) ? 16 : 4;
 348   
 349      data_out_file = ws_fopen(follow_info->data_out_filename, "rb");
 350      if (data_out_file == NULL) {
 351          simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
 352                        "Could not open temporary file %s: %s", follow_info->data_out_filename,
 353                        strerror(errno));
 354          return FRS_OPEN_ERROR;
 355      }
 356   
 357      while ((nchars=fread(&sc, 1, sizeof(sc), data_out_file))) {
 358          if (nchars != sizeof(sc)) {
 359              simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
 360                            "Short read from temporary file %s: expected %lu, got %lu",
 361                            follow_info->data_out_filename,
 362                            (unsigned long)sizeof(sc),
 363                            (unsigned long)nchars);
 364              fclose(data_out_file);
 365              data_out_file = NULL;
 366              return FRS_READ_ERROR;
 367          }
 368          if (client_port == 0) {
 369              memcpy(client_addr, sc.src_addr, iplen);
 370              client_port = sc.src_port;
 371          }
 372          skip = FALSE;
 373          if (memcmp(client_addr, sc.src_addr, iplen) == 0 &&
 374              client_port == sc.src_port) {
 375              is_server = FALSE;
 376              global_pos = &global_client_pos;
 377              if (follow_info->show_stream == FROM_SERVER) {
 378                  skip = TRUE;
 379              }
 380          }
 381          else {
 382              is_server = TRUE;
 383              global_pos = &global_server_pos;
 384              if (follow_info->show_stream == FROM_CLIENT) {
 385                  skip = TRUE;
 386              }
 387          }
 388   
 389          while (sc.dlen > 0) {
 390              bcount = (sc.dlen < FLT_BUF_SIZE) ? sc.dlen : FLT_BUF_SIZE;
 391              nchars = fread(buffer, 1, bcount, data_out_file);
 392              if (nchars == 0)
 393                  break;
 394              /* XXX - if we don't get "bcount" bytes, is that an error? */
 395              sc.dlen -= (guint32) nchars;
 396   
 397              if (!skip) {
 398                      frs_return = follow_show(follow_info, print_line, buffer,
 399                                               nchars, is_server, arg, global_pos,
 400                                               &server_packet_count,
 401[+]                                              &client_packet_count);
expand/collapse

follow_show

(/home/sate/Testcases/c/cve/wireshark-1.2.0/gtk/follow_stream.c)expand/collapse
Show more  
 977  follow_show(follow_info_t *follow_info,
 978              gboolean (*print_line)(char *, size_t, gboolean, void *),
 979              char *buffer, size_t nchars, gboolean is_server, void *arg,
 980              guint32 *global_pos, guint32 *server_packet_count,
 981              guint32 *client_packet_count)
 982  {
 983          gchar initbuf[256];
 984          guint32 current_pos;
 985          static const gchar hexchars[16] = "0123456789abcdef";
 986   
 987          switch (follow_info->show_type) {
 988   
 989          case SHOW_EBCDIC:
 990                  /* If our native arch is ASCII, call: */
 991[+]                 EBCDIC_to_ASCII(buffer, (guint) nchars);
expand/collapse

EBCDIC_to_ASCII

(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/charsets.c)expand/collapse
Show more  
 128  EBCDIC_to_ASCII(guint8 *buf, guint bytes)
 129  {
 130          guint   i;
 131          guint8  *bufptr;
 132   
 133          bufptr = buf;
 134   
 135          for (i = 0; i < bytes; i++, bufptr++) {
 136                  *bufptr = EBCDIC_translate_ASCII[*bufptr];
Show more  
Show more  
 402                      if(frs_return == FRS_PRINT_ERROR) {
Show more  




Change Warning 4082.30359 : Buffer Overrun

Priority:
State:
Finding:
Owner:
Note: