Skip to content

fix verify_cc.cc init() operator #1179

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 12 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/actions/allow.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@ class Allow : public Action {
static std::string allowTypeToName (AllowType a) {
if (a == NoneAllowType) {
return "None";
} else if (a = RequestAllowType) {
} else if (a == RequestAllowType) {
return "Request";
} else if (a = PhaseAllowType) {
} else if (a == PhaseAllowType) {
return "Phase";
} else if (a = FromNowOneAllowType) {
} else if (a == FromNowOneAllowType) {
return "FromNowOne";
} else {
return "Unknown";
Expand Down
15 changes: 13 additions & 2 deletions src/operators/verify_cc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,20 @@ bool VerifyCC::init(const std::string &param2, std::string *error) {

m_pc = pcre_compile(param.c_str(), PCRE_DOTALL|PCRE_MULTILINE,
&errptr, &erroffset, NULL);
m_pce = pcre_study(m_pc, PCRE_STUDY_JIT_COMPILE, &errptr);
if (m_pc == NULL) {
error->assign(errptr);
return false;
}

if ((m_pc == NULL) || (m_pce == NULL)) {
m_pce = pcre_study(m_pc, PCRE_STUDY_JIT_COMPILE, &errptr);
if (m_pce == NULL) {
if (errptr == NULL) {
/*
* Per pcre_study(3) m_pce == NULL && errptr == NULL means
* that no addional information is found, so no need to study
*/
return true;
}
error->assign(errptr);
return false;
}
Expand Down
4 changes: 3 additions & 1 deletion src/transaction.cc
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,8 @@ bool Transaction::extractArguments(const std::string &orig,
free(key_c);
free(value_c);
}

return true;
}


Expand Down Expand Up @@ -1740,7 +1742,7 @@ extern "C" int msc_request_body_from_file(Transaction *transaction,

/**
* @name msc_process_response_headers
* @brief Perform the analysis on the response readers.
* @brief Perform the analysis on the response headers.
*
* This function perform the analysis on the response headers, notice however
* that the headers should be added prior to the execution of this function.
Expand Down