[PATCH] db: Add more tests for retrieving subscribers from a DB and avoid NULL dereference when something goes wrong in tests.

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/OpenBSC@lists.osmocom.org/.

Holger Hans Peter Freyther holger at freyther.de
Sun Oct 6 11:41:26 UTC 2013


On Sat, Oct 05, 2013 at 12:16:07PM +0200, Alexander Chemeris wrote:
>  #define SUBSCR_PUT(sub) \
> -	sub->net = &dummy_net;	\
> -	subscr_put(sub);
> +	if (sub) { \
> +		sub->net = &dummy_net;	\
> +		subscr_put(sub); \
> +	}

I don't like this semantic change. Either the tests expects a valid
subscriber or it doesn't. It is not a "maybe" this query will result
in a look up.





More information about the OpenBSC mailing list