[Asterisk-code-review] geoloc_eprofile.c: Fix setting of loc_src in set_loc_src() (asterisk[19])

Kevin Harwell asteriskteam at digium.com
Wed Jul 13 15:20:02 CDT 2022


Kevin Harwell has submitted this change. ( https://gerrit.asterisk.org/c/asterisk/+/18813 )

Change subject: geoloc_eprofile.c: Fix setting of loc_src in set_loc_src()
......................................................................

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
---
M res/res_geolocation/geoloc_eprofile.c
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Joshua Colp: Looks good to me, but someone else must approve
  Sean Bright: Looks good to me, approved
  Kevin Harwell: Approved for Submit



diff --git a/res/res_geolocation/geoloc_eprofile.c b/res/res_geolocation/geoloc_eprofile.c
index 64244f4..af0e89c 100644
--- a/res/res_geolocation/geoloc_eprofile.c
+++ b/res/res_geolocation/geoloc_eprofile.c
@@ -193,7 +193,7 @@
 
 	loc_src = strchr(local_uri, ';');
 	if (loc_src) {
-		loc_src = '\0';
+		*loc_src = '\0';
 		loc_src++;
 	}
 

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/18813
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 19
Gerrit-Change-Id: Id247be113cc8510f043ca053d5b4f5f3d32acd29
Gerrit-Change-Number: 18813
Gerrit-PatchSet: 1
Gerrit-Owner: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: Joshua Colp <jcolp at sangoma.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-Reviewer: Sean Bright <sean at seanbright.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20220713/d94fb330/attachment.html>


More information about the asterisk-code-review mailing list