From: George Joseph Date: Wed, 13 Jul 2022 18:38:10 +0000 (-0600) Subject: geoloc_eprofile.c: Fix setting of loc_src in set_loc_src() X-Git-Tag: 18.14.0-rc1~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fcc3e7fac61b9e4b37b9f6710e0bfb3074b28242;p=thirdparty%2Fasterisk.git geoloc_eprofile.c: Fix setting of loc_src in set_loc_src() line 196: loc_src = '\0'; should have been line 196: *loc_src = '\0'; The issue was caught by the gcc optimizer complaining that loc_src had a zero length because the pointer itself was being set to NULL instead of the _contents_ of the pointer being set to the NULL terminator. ASTERISK-30138 Reported-by: Sean Bright Change-Id: Id247be113cc8510f043ca053d5b4f5f3d32acd29 --- diff --git a/res/res_geolocation/geoloc_eprofile.c b/res/res_geolocation/geoloc_eprofile.c index 64244f4424..af0e89c8e4 100644 --- a/res/res_geolocation/geoloc_eprofile.c +++ b/res/res_geolocation/geoloc_eprofile.c @@ -193,7 +193,7 @@ static int set_loc_src(struct ast_geoloc_eprofile *eprofile, const char *uri, co loc_src = strchr(local_uri, ';'); if (loc_src) { - loc_src = '\0'; + *loc_src = '\0'; loc_src++; }