(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-vcdu.c) |
| |
| 161 | | | static const char* smex_time_to_string ( int pb5_days_since_midnight_9_10_oct_1995, int pb5_seconds, int pb5_milliseconds ) |
| 162 | | | { |
| 163 | | | static const char* fmt = "%04d/%03d:%02d:%02d:%02d.%03d"; |
| 164 | | | static char juliantime[40]; |
| 165 | | | static int utcdiff = 0; |
| 166 | | | |
| 167 | | | static int Days[2][13] = |
| 168 | | | { |
| 169 | | | { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }, |
| 170 | | | { 0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 } |
| 171 | | | }; |
| 172 | | | |
| 173 | | | int utc, yr, year, julianday, hour, minute, second; |
| 174 | | | int ix, days, month; |
| 175 | | | |
| 176 | | | |
| 177 | | | |
| 178 | | | |
| 179 | | | |
| 180 | | | if ( 0 == utcdiff ) |
| 181 | | | { |
| 182 | | | for ( yr=1970; yr < 1995; ++yr ) |
| 183 | | | { |
| 184 | | | utcdiff += ( Leap(yr) ? 366 : 365 ) * 24 * 60 * 60;
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-vcdu.c |
| |
115 | # define Leap(yr) ( ( 0 == (yr)%4 && 0 != (yr)%100 ) || ( 0 == (yr)%400 ) ) |
| |
|
| 185 | | | } |
| 186 | | | |
| 187 | | | days = 0; |
| 188 | | | ix = ( Leap(1995) ? 1 : 0 );
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-vcdu.c |
| |
115 | # define Leap(yr) ( ( 0 == (yr)%4 && 0 != (yr)%100 ) || ( 0 == (yr)%400 ) ) |
| |
|
Unreachable Data Flow
The highlighted code will not execute under any circumstances. This may be because of: |
|
| 189 | | | |
| 190 | | | for ( month=1; month < 10; ++month ) |
| 191 | | | { |
| 192 | | | days += Days[ix][month]; |
| 193 | | | } |
| 194 | | | |
| 195 | | | days += 9; |
| 196 | | | |
| 197 | | | utcdiff += days * 24 * 60 * 60; |
| 198 | | | } |
| 199 | | | |
| 200 | | | utc = ( pb5_days_since_midnight_9_10_oct_1995 * 86400 ) + pb5_seconds + utcdiff; |
| 201 | | | utc_to_julian ( utc, &year, &julianday, &hour, &minute, &second ); |
| 202 | | | |
| 203 | | | g_snprintf ( juliantime, sizeof(juliantime), fmt, year, julianday, hour, minute, second, pb5_milliseconds ); |
| 204 | | | |
| 205 | | | return juliantime; |
| 206 | | | |
| 207 | | | } |
| |