Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/10334 )

Change subject: GSCON: fix segfault after gscon timout
......................................................................


Patch Set 1: Code-Review-1

(1 comment)

https://gerrit.osmocom.org/#/c/10334/1/src/osmo-bsc/bsc_subscr_conn_fsm.c
File src/osmo-bsc/bsc_subscr_conn_fsm.c:

https://gerrit.osmocom.org/#/c/10334/1/src/osmo-bsc/bsc_subscr_conn_fsm.c@788
PS1, Line 788:                  a_reset_conn_fail(conn->sccp.msc->a.reset_fsm);
it would be great if the burden of checking this is not placed on the caller.  
Having to think of if-constructs every time you call a function is error-prone. 
 One option would be to provide a "msc_a_reset_conn_fail(msc)" function, which 
then checks if msc != NULL, and only in that case proceed to dereference it.  
Even if currently this is the only location where that new function is used, 
further development might make a developer copy the function invocation to 
other places, and we'd get the protection for free.

Make APIs easy to use and easy to get right.



--
To view, visit https://gerrit.osmocom.org/10334
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I0802aaadf0af4e58e41c98999e8c6823838adb61
Gerrit-Change-Number: 10334
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <[email protected]>
Gerrit-Reviewer: Harald Welte <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Comment-Date: Sun, 05 Aug 2018 07:08:32 +0000
Gerrit-HasComments: Yes
Gerrit-HasLabels: Yes

Reply via email to