Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#2022 closed Bugs (invalid)

Found crash of boost for characters ' * ' , ' a* ' , & " abc** "

Reported by: md.salim.hussain@… Owned by: John Maddock
Milestone: Component: regex
Version: Boost 1.34.0 Severity: Showstopper
Keywords: Cc:

Description

Hi, I have found crash of Boost Regex Library whenever I give search Pattern '*' or 'a*' or 'abc' i.e. multiple occurence of * My code is like this:

#include "GrepWrapper.h" #include <stdio.h> using namespace std; char pattern[] =

"aa moduladfe=message&_action=view5080|" "*|" "*GET|" "ya|" "tarewq*|" ;

char buf[] =

"GET" "yaaaa" "GET";

int main(int argc, char argv) {

int nRetValue = 0; CGrepWrapper objGrepWrapper; objGrepWrapper.SetSearchPattern(pattern);

ACE_Vector<std::string> vOutputVector; nRetValue = objGrepWrapper.ApplyFilter(buf, 10, vOutputVector, true); int nVectorLen = vOutputVector.size(); if (nVectorLen > 0) {

for (int i = 0 ; i < nVectorLen; i++) {

printf("\t%s", vOutputVector[i].c_str()); vOutputVector.pop_back();

}

} else {

printf("\nNot Found");

}

return 0;

}

Change History (2)

comment:1 by John Maddock, 14 years ago

Resolution: invalid
Status: newclosed

Neither "*" nor "abc" are valid regular expressions: as a result Boost.Regex will throw a boost::regex_error exception. It's up to you to catch the exception, if you don't then the program *will* terminate with an uncaught exception error. This behaviour is intentional.

HTH, John Maddock.

comment:2 by (none), 14 years ago

Milestone: Boost 1.35.1

Milestone Boost 1.35.1 deleted

Note: See TracTickets for help on using tickets.