[Asterisk-code-review] pbx.c: Properly parse labels with leading digits (...asterisk[13])
Sean Bright
asteriskteam at digium.com
Thu Apr 11 13:37:44 CDT 2019
Sean Bright has uploaded this change for review. ( https://gerrit.asterisk.org/c/asterisk/+/11264
Change subject: pbx.c: Properly parse labels with leading digits
......................................................................
pbx.c: Properly parse labels with leading digits
If the target of a Goto is a label that starts with a number, we
erroneously treat the leading digits as a priority.
ASTERISK-20182 #close
Reported by: Janu
Change-Id: Ia78408c0805a729103917247ecfc802f6fafc94b
---
M main/pbx.c
1 file changed, 2 insertions(+), 1 deletion(-)
git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/64/11264/1
diff --git a/main/pbx.c b/main/pbx.c
index b4a5448..911aaab 100644
--- a/main/pbx.c
+++ b/main/pbx.c
@@ -8616,6 +8616,7 @@
char *stringp;
int ipri;
int mode = 0;
+ char rest[2] = "";
if (ast_strlen_zero(goto_string)) {
ast_log(LOG_WARNING, "Goto requires an argument ([[context,]extension,]priority)\n");
@@ -8641,7 +8642,7 @@
mode = -1;
pri++;
}
- if (sscanf(pri, "%30d", &ipri) != 1) {
+ if (sscanf(pri, "%30d%1s", &ipri, rest) != 1) {
ipri = ast_findlabel_extension(chan, context ? context : ast_channel_context(chan),
exten ? exten : ast_channel_exten(chan), pri,
S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, NULL));
--
To view, visit https://gerrit.asterisk.org/c/asterisk/+/11264
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Change-Id: Ia78408c0805a729103917247ecfc802f6fafc94b
Gerrit-Change-Number: 11264
Gerrit-PatchSet: 1
Gerrit-Owner: Sean Bright <sean.bright at gmail.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20190411/c3bf672b/attachment.html>
More information about the asterisk-code-review
mailing list