Commit 813b905
authored
[ice] Avoid unchecked incrementation of port number to avoid potential panic due to overflow in debug, or silent overflow in release (#719)
When `port_start` is assigned the value `u16::MAX`, and the socket
cannot be bound to port `u16::MAX`, an unhandled overflow will occur.
When building webrtc-rs using the debug profile, this overflow will lead
to a panic, and worse yet in the release profile, a silent overflow and
wrap around will occur, allowing `listen_udp_in_port_range` to bind to a
port outside of the specified port range.1 parent 310f7a0 commit 813b905
1 file changed
+34
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
163 | 163 | | |
164 | 164 | | |
165 | 165 | | |
166 | | - | |
| 166 | + | |
| 167 | + | |
167 | 168 | | |
168 | 169 | | |
169 | 170 | | |
| |||
174 | 175 | | |
175 | 176 | | |
176 | 177 | | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
0 commit comments