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

George Joseph asteriskteam at digium.com
Wed Jul 13 13:44:27 CDT 2022


George Joseph has uploaded this change for review. ( https://gerrit.asterisk.org/c/asterisk/+/18814 )


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(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/14/18814/1

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/+/18814
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Change-Id: Id247be113cc8510f043ca053d5b4f5f3d32acd29
Gerrit-Change-Number: 18814
Gerrit-PatchSet: 1
Gerrit-Owner: George Joseph <gjoseph at digium.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20220713/9122b146/attachment-0001.html>


More information about the asterisk-code-review mailing list