Commit a1386af
tcp options: fix possible shift-out-of-bounds
Calculation of tcp option bit is done before actual check and could lead
to shift-out-of-bounds error tracked by UBSAN. Fix it by checking for
zero value before the calculation.
While here also fix bit calculation because it should be 31-based
instead of 32-based.
Signed-off-by: Vadim Fedorenko <vvfedorenko@github.com>1 parent 40fefb2 commit a1386af
1 file changed
+8
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4821 | 4821 | | |
4822 | 4822 | | |
4823 | 4823 | | |
4824 | | - | |
| 4824 | + | |
4825 | 4825 | | |
4826 | 4826 | | |
4827 | 4827 | | |
| |||
4842 | 4842 | | |
4843 | 4843 | | |
4844 | 4844 | | |
4845 | | - | |
| 4845 | + | |
4846 | 4846 | | |
4847 | 4847 | | |
4848 | 4848 | | |
4849 | 4849 | | |
4850 | | - | |
4851 | | - | |
| 4850 | + | |
| 4851 | + | |
4852 | 4852 | | |
4853 | 4853 | | |
4854 | 4854 | | |
| 4855 | + | |
| 4856 | + | |
4855 | 4857 | | |
4856 | 4858 | | |
4857 | | - | |
| 4859 | + | |
4858 | 4860 | | |
4859 | | - | |
4860 | | - | |
4861 | | - | |
| 4861 | + | |
4862 | 4862 | | |
4863 | | - | |
4864 | | - | |
4865 | 4863 | | |
4866 | 4864 | | |
4867 | 4865 | | |
| |||
0 commit comments