(/home/sate/Testcases/c/cve/wireshark-1.2.0/wiretap/ngsniffer.c) |
| |
| 1835 | | | static int (int encap, const guint8 *pd, int len, |
| 1836 | | | union *) |
| 1837 | | | { |
| 1838 | | | switch (encap) { |
| 1839 | | | |
| 1840 | | | case WTAP_ENCAP_PER_PACKET: |
| 1841 | | | |
| 1842 | | | |
| 1843 | | | |
| 1844 | | | encap = infer_pkt_encap(pd, len); |
| 1845 | | | |
| 1846 | | | |
| 1847 | | | |
| 1848 | | | |
| 1849 | | | |
| 1850 | | | switch (encap) { |
Redundant Condition
encap == 17 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 encap == 17 cannot be true.
- A crashing bug occurs on every path where encap == 17 could have evaluated to true. Look for a preceding Null Pointer Dereference or Division By Zero warning.
|
|
| 1851 | | | |
| 1852 | | | case WTAP_ENCAP_WFLEET_HDLC: |
| 1853 | | | case WTAP_ENCAP_CHDLC_WITH_PHDR: |
| 1854 | | | case WTAP_ENCAP_PPP_WITH_PHDR: |
| 1855 | | | if (->x25.flags == 0) |
| 1856 | | | ->p2p.sent = TRUE; |
| 1857 | | | else |
| 1858 | | | ->p2p.sent = FALSE; |
| 1859 | | | break; |
| 1860 | | | |
| 1861 | | | case WTAP_ENCAP_ISDN: |
| 1862 | | | if (->x25.flags == 0x00) |
| 1863 | | | ->isdn.uton = FALSE; |
| 1864 | | | else |
| 1865 | | | ->isdn.uton = TRUE; |
| 1866 | | | |
| 1867 | | | |
| 1868 | | | |
| 1869 | | | |
| 1870 | | | |
| 1871 | | | |
| 1872 | | | |
| 1873 | | | |
| 1874 | | | |
| 1875 | | | |
| 1876 | | | |
| 1877 | | | ->isdn.channel = 0; |
| 1878 | | | break; |
| 1879 | | | } |
| 1880 | | | break; |
| 1881 | | | |
| 1882 | | | case WTAP_ENCAP_ATM_PDUS: |
| 1883 | | | |
| 1884 | | | |
| 1885 | | | |
| 1886 | | | |
| 1887 | | | |
| 1888 | | | |
| 1889 | | | |
| 1890 | | | |
| 1891 | | | |
| 1892 | | | |
| 1893 | | | |
| 1894 | | | |
| 1895 | | | if (->atm.type == TRAF_LANE && len >= 2) { |
| 1896 | | | if (pd[0] == 0xff && pd[1] == 0x00) { |
| 1897 | | | |
| 1898 | | | |
| 1899 | | | |
| 1900 | | | ->atm.subtype = |
| 1901 | | | TRAF_ST_LANE_LE_CTRL; |
| 1902 | | | } else { |
| 1903 | | | |
| 1904 | | | |
| 1905 | | | |
| 1906 | | | if (->atm.subtype == |
| 1907 | | | TRAF_ST_LANE_LE_CTRL) { |
| 1908 | | | |
| 1909 | | | |
| 1910 | | | |
| 1911 | | | ->atm.subtype = |
| 1912 | | | TRAF_ST_LANE_802_3; |
| 1913 | | | } |
| 1914 | | | } |
| 1915 | | | } |
| 1916 | | | break; |
| 1917 | | | } |
| 1918 | | | return encap; |
| 1919 | | | } |
| |