]> git.ipfire.org Git - thirdparty/asterisk.git/commit
Fix handling of backreferences for ENUM lookups
authorDavid Vossel <dvossel@digium.com>
Fri, 6 Mar 2009 17:19:55 +0000 (17:19 +0000)
committerDavid Vossel <dvossel@digium.com>
Fri, 6 Mar 2009 17:19:55 +0000 (17:19 +0000)
commit04836d554d5b742331a1d2ae096c4211a7518a22
tree68ed9f0d90fc16fdc65a2a7fc23d3933088cd250
parentaef6c114f18e747f66f4b4ea3a3f828cfe9b73c1
Fix handling of backreferences for ENUM lookups

enum.c did not handle regex backtraces correctly.  The '\1' in the regex is a backreference that requires a pattern match to be inserted.  The way the code used to work is that it would find the backreference and insert the entire input string minus the '+'.  This is incorrect.  The regexec() function takes in a variable called pmatch which is an array of structs containing the start and end indexes for each backreference substring.  The original code actually passed the pmatch array pointer into regexec but never did anything with it.  Now when a backtrace is found, the backtrace number is looked up in the pmatch array and the correct substring is inserted.

(closes issue #14576)
Reported by: chris-mac
Review: http://reviewboard.digium.com/r/187/

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@180532 65c4cc65-6c06-0410-ace0-fbb531ad65f3
main/enum.c