Commit 5edcf5d
committed
smart_pkt: adjust style of "ref" packet parsing function
While the function parsing ref packets doesn't have any immediately
obvious buffer overflows, it's style is different to all the other
parsing functions. Instead of checking buffer length while we go, it
does a check up-front. This causes the code to seem a lot more magical
than it really is due to some magic constants. Refactor the function to
instead make use of the style of other packet parser and verify buffer
lengths as we go.1 parent 786426e commit 5edcf5d
1 file changed
+19
-25
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
206 | 206 | | |
207 | 207 | | |
208 | 208 | | |
209 | | - | |
210 | 209 | | |
211 | 210 | | |
212 | 211 | | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
| 212 | + | |
219 | 213 | | |
220 | | - | |
221 | | - | |
222 | 214 | | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | 215 | | |
233 | | - | |
234 | | - | |
235 | | - | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
236 | 228 | | |
237 | 229 | | |
238 | 230 | | |
| |||
244 | 236 | | |
245 | 237 | | |
246 | 238 | | |
247 | | - | |
| 239 | + | |
248 | 240 | | |
249 | | - | |
250 | 241 | | |
251 | 242 | | |
252 | 243 | | |
253 | 244 | | |
254 | | - | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
255 | 249 | | |
256 | | - | |
| 250 | + | |
257 | 251 | | |
258 | 252 | | |
259 | 253 | | |
| |||
0 commit comments