Change in osmo-bsc[master]: GSCON: fix segfault after gscon timout

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Sun Aug 5 07:08:32 UTC 2018


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 <pmaier at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Comment-Date: Sun, 05 Aug 2018 07:08:32 +0000
Gerrit-HasComments: Yes
Gerrit-HasLabels: Yes
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20180805/ca30c084/attachment.htm>


More information about the gerrit-log mailing list