Text   |  XML   |  ReML   |   Visible Warnings:

Unreachable Data Flow  at packet-camel.c:3157

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

dissect_camel_DateAndTime

(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-camel.c)expand/collapse
Show more  
 3062  dissect_camel_DateAndTime(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
 3063   
 3064   
 3065  /*  
 3066  * date_option = 1 european dd:mm:yyyy
 3067  * date_option = 2 american mm:dd:yyyy
 3068  */
 3069   
 3070  /*
 3071  * Output should be HH:MM:SS;dd/mm/yyyy
 3072  * if european is selected, and HH:MM:SS;mm/dd/yyyy
 3073  * otherwise.
 3074  */
 3075   
 3076    guint8 digit_pair;
 3077    guint8 i = 0, curr_offset;  
 3078    char time[CAMEL_DATE_AND_TIME_LEN];
 3079    char c[CAMEL_DATE_AND_TIME_LEN]; /*temporary container*/
 3080   
 3081    /* 2 digits per octet, 7 octets total + 5 delimiters */
 3082       
 3083    for (curr_offset = 0; curr_offset < 7 ; curr_offset++)    
 3084    /*Loop to extract date*/
 3085    {
 3086        digit_pair = tvb_get_guint8(tvb, curr_offset);
 3087         
 3088        proto_tree_add_uint(tree,
 3089                            hf_digit,
 3090                            tvb,
 3091                            curr_offset,
 3092                            1,
 3093                            digit_pair & 0x0F);
 3094   
 3095        proto_tree_add_uint(tree,
 3096                            hf_digit,
 3097                            tvb,
 3098                            curr_offset,
 3099                            1,
 3100                            digit_pair >>4);
 3101                             
 3102         
 3103        c[i] = camel_number_to_char( digit_pair & 0x0F);
 3104        i++;
 3105        c[i] = camel_number_to_char( digit_pair >>4);
 3106        i++;
 3107    }
 3108     
 3109    /* Pretty print date */
 3110    /* XXX - Should we use sprintf here instead of assembling the string by 
 3111     * hand? */
 3112     
 3113    time[0] = c[8];
 3114    time[1] = c[9];
 3115    time[2] = ':';
 3116    time[3] = c[10];
 3117    time[4] = c[11];
 3118    time[5] = ':';
 3119    time[6] = c[12];
 3120    time[7] = c[13];
 3121    time[8] = ';';
 3122    if ( EUROPEAN_DATE == date_format) /*european*/
 3123    {
 3124      time[9] = c[6]; /*day*/
 3125      time[10] = c[7];
 3126      time[11] = '/';  
 3127      time[12] = c[4]; /*month*/
 3128      time[13] = c[5];
 3129    }
 3130    else /*american*/
 3131    {
 3132      time[9] = c[4]; /*month*/
 3133      time[10] = c[5];
 3134      time[11] = '/';  
 3135      time[12] = c[6]; /*day*/
 3136      time[13] = c[7];
 3137    }
 3138    time[14] = '/';
 3139    time[15] = c[0];
 3140    time[16] = c[1];
 3141    time[17] = c[2];
 3142    time[18] = c[3];
 3143   
 3144    time[CAMEL_DATE_AND_TIME_LEN - 1] = '\0';
 3145   
 3146  /*start = 0, length = 7*/
 3147   
 3148    proto_tree_add_string(tree,  
 3149                        hf_index,  
 3150                        tvb,
 3151                        0,  
 3152                        7,  
 3153                        time);
 3154   
 3155    return 7; /* 7  octets eaten*/
 3156   
 3157    return offset;
 3158  }
Show more  




Change Warning 3110.31437 : Unreachable Data Flow

Priority:
State:
Finding:
Owner:
Note: