Commit 0e7a534
fix(params): reject non-finite values (inf, nan) in parameter files
float() silently accepts "inf", "-inf", "nan", and "infinity" as valid
values. When loading .param files, these non-finite values were stored
in the parameter dictionary without validation and could be uploaded to
the flight controller, causing undefined firmware behavior.
Added math.isfinite() check in _validate_parameter() to reject
non-finite values with a clear error message. Added BDD test covering
all non-finite value variants.
Signed-off-by: Yash Goel <yashhzd@users.noreply.github.com>
Signed-off-by: YASH GOEL <yashhzd@YASHs-Mac-Studio.local>1 parent 66b7652 commit 0e7a534
File tree
2 files changed
+34
-1
lines changed- ardupilot_methodic_configurator
- tests
2 files changed
+34
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
197 | 198 | | |
198 | 199 | | |
199 | 200 | | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
200 | 206 | | |
201 | 207 | | |
202 | | - | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
203 | 211 | | |
204 | 212 | | |
205 | 213 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
1495 | 1496 | | |
1496 | 1497 | | |
1497 | 1498 | | |
| 1499 | + | |
| 1500 | + | |
| 1501 | + | |
| 1502 | + | |
| 1503 | + | |
| 1504 | + | |
| 1505 | + | |
| 1506 | + | |
| 1507 | + | |
| 1508 | + | |
| 1509 | + | |
| 1510 | + | |
| 1511 | + | |
| 1512 | + | |
| 1513 | + | |
| 1514 | + | |
| 1515 | + | |
| 1516 | + | |
| 1517 | + | |
| 1518 | + | |
| 1519 | + | |
| 1520 | + | |
| 1521 | + | |
| 1522 | + | |
0 commit comments