From: Sean Bright Date: Fri, 7 Jul 2023 14:11:44 +0000 (-0400) Subject: res_geolocation: Ensure required 'location_info' is present. X-Git-Tag: 21.0.0-pre1~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fe467d595c37ec37d5f15b9b37bf85532b42208f;p=thirdparty%2Fasterisk.git res_geolocation: Ensure required 'location_info' is present. Fixes #189 --- diff --git a/res/res_geolocation/geoloc_config.c b/res/res_geolocation/geoloc_config.c index 26dd2d9fd1..88857c4957 100644 --- a/res/res_geolocation/geoloc_config.c +++ b/res/res_geolocation/geoloc_config.c @@ -168,6 +168,12 @@ static int geoloc_location_apply_handler(const struct ast_sorcery *sorcery, void enum ast_geoloc_validate_result result; int rc = 0; + if (!location->location_info) { + ast_log(LOG_ERROR, "Location '%s' is missing required element 'location_info'", + location_id); + return -1; + } + result = validate_location_info(location_id, location->format, location->location_info); if (result != AST_GEOLOC_VALIDATE_SUCCESS) { return -1;