Text   |  XML   |  ReML   |   Visible Warnings:

Uninitialized Variable  at packet-smb-common.c:320

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

dissect_4_2_16_13

(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-smb.c)expand/collapse
Show more  
 11882  dissect_4_2_16_13(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
 11883                    int offset, guint16 *bcp, gboolean *trunc)
 11884  {
 11885          smb_info_t *si = pinfo->private_data;
 11886          const char *fn;
 11887          int fn_len;
 11888   
 11889          DISSECTOR_ASSERT(si);
 11890   
 11891          /* Link destination */
 11892   
 11893          fn = get_unicode_or_ascii_string(
 11894[+]                 tvb, &offset, si->unicode, &fn_len, FALSE, TRUE, bcp);
expand/collapse

get_unicode_or_ascii_string

(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-smb-common.c)expand/collapse
Show more  
 280  const gchar *
 281  get_unicode_or_ascii_string(tvbuff_t *tvb, int *offsetp,
 282      gboolean useunicode, int *len, gboolean nopad, gboolean exactlen,
 283      guint16 *bcp)
 284  {
 285    gchar *cur;
 286    const gchar *string;
 287    int string_len = 0;
 288    int copylen;
 289    gboolean overflow = FALSE;
 290   
 291    if (*bcp == 0) {
 292      /* Not enough data in buffer */
 293      return NULL;
 294    }
 295    if (useunicode) {
 296      if ((!nopad) && (*offsetp % 2)) {
 297        (*offsetp)++;   /* Looks like a pad byte there sometimes */
 298        (*bcp)--;
 299        if (*bcp == 0) {
 300          /* Not enough data in buffer */
 301          return NULL;
 302        }
 303      }
 304      if(exactlen){
 305        string_len = *len;
 306        if (string_len < 0) {
 307          /* This probably means it's a very large unsigned number; just set
 308             it to the largest signed number, so that we throw the appropriate
 309             exception. */
 310          string_len = INT_MAX;
 311        }
 312      }
 313      string = unicode_to_str(tvb, *offsetp, &string_len, exactlen, *bcp);
 314    } else {
 315      if(exactlen){
 316        /*
 317         * The string we return must be null-terminated.
 318         */
 319        cur=ep_alloc(MAX_UNICODE_STR_LEN+3+1);
 320        copylen = *len;
Show more  
Show more  




Change Warning 2972.31713 : Uninitialized Variable

Priority:
State:
Finding:
Owner:
Note: