Text   |  XML   |  ReML   |   Visible Warnings:

Uninitialized Variable  at dct3trace.c:271

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

dct3trace_get_packet

(/home/sate/Testcases/c/cve/wireshark-1.2.0/wiretap/dct3trace.c)expand/collapse
Show more  
 210  static gboolean dct3trace_get_packet(FILE *fh, union wtap_pseudo_header *pseudo_header,
 211          unsigned char *buf, int *len, int *err, gchar **err_info)
 212  {
 213          unsigned char line[1024];
 214          gboolean have_data = FALSE;
 215   
 216          while (file_gets(line, sizeof(line), fh) != NULL)
 217          {
 218                  if( memcmp(dct3trace_magic_end, line, strlen(dct3trace_magic_end)) == 0 )
 219                  {
 220                          /* Return on end of file </dump> */
 221                          *err = 0;
 222                          return FALSE;
 223                  }
 224                  else if( memcmp(dct3trace_magic_record_end, line, strlen(dct3trace_magic_record_end)) == 0 )
 225                  {
 226                          /* Return on end of record </l1> */
 227                          if( have_data )
 228                          {
 229                                  *err = 0;
 230                                  return TRUE;
 231                          }
 232                          else 
 233                          {
 234                                  /* If not got any data return error */
 235                                  *err = WTAP_ERR_BAD_RECORD;
 236                                  *err_info = g_strdup_printf("dct3trace: record without data");
 237                                  return FALSE;
 238                          }
 239                  }
 240                  else if( memcmp(dct3trace_magic_record_start, line, strlen(dct3trace_magic_record_start)) == 0 )
 241                  {
 242                          /* Parse L1 header <l1 ...>*/
 243                          int channel, tmp, ret = 0;
 244                          char *ptr;
 245   
 246                          pseudo_header->gsm_um.uplink = !strstr(line, "direction=\"down\"");
 247[+]                         ret |= xml_get_int(&channel, line, "logicalchannel");
 248   
 249                          /* Parse downlink only fields */
 250                          if( !pseudo_header->gsm_um.uplink )
 251                          {
 252                                  ret |= xml_get_int(&tmp, line, "physicalchannel");
 253                                  pseudo_header->gsm_um.arfcn = tmp;
 254                                  ret |= xml_get_int(&tmp, line, "sequence");
 255                                  pseudo_header->gsm_um.tdma_frame = tmp;
 256                                  ret |= xml_get_int(&tmp, line, "bsic");
 257                                  pseudo_header->gsm_um.bsic = tmp;
 258                                  ret |= xml_get_int(&tmp, line, "error");
 259                                  pseudo_header->gsm_um.error = tmp;
 260                                  ret |= xml_get_int(&tmp, line, "timeshift");
 261                                  pseudo_header->gsm_um.timeshift = tmp;
 262                          }
 263   
 264                          if( ret != 0 )
 265                          {
 266                                  *err = WTAP_ERR_BAD_RECORD;
 267                                  *err_info = g_strdup_printf("dct3trace: record missing mandatory attributes");
 268                                  return FALSE;
 269                          }
 270   
 271                          switch( channel )
Show more  




Change Warning 992.30021 : Uninitialized Variable

Priority:
State:
Finding:
Owner:
Note: