Commit fa8eb2f
committed
app: Add runtime safety checks for AT host
Various functions like:
* check_idle_timer()
* in_at_mode_*()
* is_idle_*()
* is_open_*()
are designed to tolerate NULL for either context or pipe
pointer. This is because sm_at_host_get_current(),
sm_at_host_get_pipe() and sm_at_host_get_current_pipe()
are designed to return NULL when there is no context or pipe
to point to.
However, few of those mentioned were not properly handling the NULL,
especially the internal check_idle_timer() caused NULL pointer
dereference if context was destroyed just before URC message was
send to that pipe.
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>1 parent cc886f7 commit fa8eb2f
1 file changed
Lines changed: 17 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
335 | 335 | | |
336 | 336 | | |
337 | 337 | | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
338 | 341 | | |
339 | 342 | | |
340 | 343 | | |
| |||
385 | 388 | | |
386 | 389 | | |
387 | 390 | | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
388 | 394 | | |
389 | 395 | | |
390 | 396 | | |
| |||
1016 | 1022 | | |
1017 | 1023 | | |
1018 | 1024 | | |
1019 | | - | |
1020 | | - | |
1021 | | - | |
1022 | | - | |
1023 | | - | |
| 1025 | + | |
| 1026 | + | |
| 1027 | + | |
| 1028 | + | |
| 1029 | + | |
| 1030 | + | |
| 1031 | + | |
1024 | 1032 | | |
1025 | 1033 | | |
1026 | 1034 | | |
| |||
1506 | 1514 | | |
1507 | 1515 | | |
1508 | 1516 | | |
1509 | | - | |
| 1517 | + | |
1510 | 1518 | | |
1511 | 1519 | | |
1512 | 1520 | | |
1513 | 1521 | | |
1514 | | - | |
| 1522 | + | |
1515 | 1523 | | |
1516 | 1524 | | |
1517 | 1525 | | |
1518 | 1526 | | |
1519 | 1527 | | |
1520 | 1528 | | |
1521 | 1529 | | |
1522 | | - | |
| 1530 | + | |
1523 | 1531 | | |
1524 | 1532 | | |
1525 | 1533 | | |
| |||
1529 | 1537 | | |
1530 | 1538 | | |
1531 | 1539 | | |
1532 | | - | |
| 1540 | + | |
1533 | 1541 | | |
1534 | 1542 | | |
1535 | 1543 | | |
| |||
0 commit comments