Commit df6392e
authored
Fix/number of interfaces bug (#39)
* Try (harder?) to detect the real number of check_interfaces
It seems like detecting the number of interfaces a device has is harder
than one might think.
Apparently those things lie HARD about that.
If you then try to allocate memory for the result based on that,
but try to write MORE results there, you get a segfault sooner or later.
This patch iterates through the answer of the device and just counts
them, so this is hopefully the safe way to do this.
* Remove suspicious type cast1 parent f89e531 commit df6392e
2 files changed
+23
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
| 51 | + | |
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
| 55 | + | |
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
84 | | - | |
| 84 | + | |
85 | 85 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
324 | 324 | | |
325 | 325 | | |
326 | 326 | | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
327 | 339 | | |
328 | 340 | | |
329 | 341 | | |
| |||
365 | 377 | | |
366 | 378 | | |
367 | 379 | | |
368 | | - | |
| 380 | + | |
| 381 | + | |
369 | 382 | | |
370 | 383 | | |
371 | 384 | | |
| 385 | + | |
372 | 386 | | |
373 | 387 | | |
374 | 388 | | |
375 | 389 | | |
376 | | - | |
| 390 | + | |
| 391 | + | |
377 | 392 | | |
378 | 393 | | |
379 | 394 | | |
| |||
0 commit comments