Most AMI-dependent modules simply call bbs_ami_session()
to get the current AMI session, but that can be NULL if we're in the middle of reconnecting, and thus any call during this time would return NULL.
Most, if not all, modules, do not check the return value and pass it to libcami blindly, which expects the session to be non-NULL, thus triggering a segmentation fault:
Segmentation fault (core dumped)
Thread 1 (Thread 0x7effd47f06c0 (LWP 28720)):
#0 ami_action (ami=0x0, action=action@entry=0x7effe8a9c008 "SoftmodemSessions", fmt=fmt@entry=0x7effe8a9c000 "Port:%u") at cami.c:1047
resp = 0x0
res = <optimized out>
actionid = <optimized out>
ap = {{gp_offset = 1919249508, fp_offset = 538976288, overflow_arg_area = 0x2020202020202020, reg_save_area = 0x2064657472617473}}
It isn't libcami's responsibility to guard against a NULL session, so we will need to avoid this. This and [LBBS-111] may require some refactoring.
You must be logged in to leave a comment.