(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-gsm_um.c) |
| |
| 59 | | | decode_arfcn(guint16 arfcn, const char **band, guint *uplink, guint *downlink) |
| 60 | | | { |
| 61 | | | |
| 62 | | | if( arfcn >= 1 && arfcn <= 124 ) { |
| 63 | | | *band = "P-GSM 900"; |
| 64 | | | *uplink = 890000 + 200 * arfcn; |
| 65 | | | *downlink = *uplink + 45000; |
| 66 | | | } |
| 67 | | | else if( arfcn == 0 ) { |
| 68 | | | *band = "E-GSM 900"; |
| 69 | | | *uplink = 890000 + 200 * arfcn; |
| 70 | | | *downlink = *uplink + 45000; |
| 71 | | | } |
| 72 | | | else if( arfcn >= 975 && arfcn <= 1023 ) { |
| 73 | | | *band = "E-GSM 900"; |
| 74 | | | *uplink = 890000 + 200 * (arfcn - 1024); |
| 75 | | | *downlink = *uplink + 45000; |
| 76 | | | } |
| 77 | | | else if( arfcn >= 955 && arfcn <= 1023 ) { |
| 78 | | | *band = "R-GSM 900"; |
| 79 | | | *uplink = 890000 + 200 * (arfcn - 1024); |
| 80 | | | *downlink = *uplink + 45000; |
| 81 | | | } |
| 82 | | | else if( arfcn >= 512 && arfcn <= 885 && dcs1800_gsm) { |
| 83 | | | *band = "DCS 1800"; |
| 84 | | | *uplink = 1710200 + 200 * (arfcn - 512); |
| 85 | | | *downlink = *uplink + 95000; |
| 86 | | | } |
| 87 | | | else if( arfcn >= 512 && arfcn <= 810 && !dcs1800_gsm) { |
Redundant Condition
dcs1800_gsm always evaluates to false. This may be because: - There is a constant assignment to one or more of the variables involved.
- An earlier conditional statement has already ensured that dcs1800_gsm cannot be true.
- A crashing bug occurs on every path where dcs1800_gsm could have evaluated to true. Look for a preceding Null Pointer Dereference or Division By Zero warning.
|
|
| 88 | | | *band = "PCS 1900"; |
| 89 | | | *uplink = 1850200 + 200 * (arfcn - 512); |
| 90 | | | *downlink = *uplink + 80000; |
| 91 | | | } |
| 92 | | | else if( arfcn >= 259 && arfcn <= 293 ) { |
| 93 | | | *band = "GSM 450"; |
| 94 | | | *uplink = 450600 + 200 * (arfcn - 259); |
| 95 | | | *downlink = *uplink + 10000; |
| 96 | | | } |
| 97 | | | else if( arfcn >= 306 && arfcn <= 340 ) { |
| 98 | | | *band = "GSM 480"; |
| 99 | | | *uplink = 479000 + 200 * (arfcn - 306); |
| 100 | | | *downlink = *uplink + 10000; |
| 101 | | | } |
| 102 | | | else if( arfcn >= 128 && arfcn <= 251 ) { |
| 103 | | | *band = "GSM 850"; |
| 104 | | | *uplink = 824200 + 200 * (arfcn - 128); |
| 105 | | | *downlink = *uplink + 45000; |
| 106 | | | } |
| 107 | | | else { |
| 108 | | | *band = "Unknown"; |
| 109 | | | *uplink = *downlink = 0; |
| 110 | | | } |
| 111 | | | } |
| |