Fixed null byte match
This commit is contained in:
@@ -27,7 +27,7 @@ ADD ./backend/requirements.txt /execute/requirements.txt
|
|||||||
RUN pip install --no-cache-dir -r /execute/requirements.txt
|
RUN pip install --no-cache-dir -r /execute/requirements.txt
|
||||||
|
|
||||||
COPY ./backend/ /execute/
|
COPY ./backend/ /execute/
|
||||||
RUN c++ -O3 -o proxy/proxy proxy/proxy.cpp -pthread -lboost_system -lboost_regex
|
RUN c++ -O3 -o proxy/proxy proxy/proxy.cpp -pthread -lboost_system
|
||||||
COPY ./config/supervisord.conf /etc/supervisor/supervisord.conf
|
COPY ./config/supervisord.conf /etc/supervisor/supervisord.conf
|
||||||
COPY ./config/nginx.conf /tmp/nginx.conf
|
COPY ./config/nginx.conf /tmp/nginx.conf
|
||||||
COPY ./config/start_nginx.sh /tmp/start_nginx.sh
|
COPY ./config/start_nginx.sh /tmp/start_nginx.sh
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ bool filter_data(unsigned char* data, const size_t& bytes_transferred, vector<pa
|
|||||||
for (pair<string,regex> ele:blacklist){
|
for (pair<string,regex> ele:blacklist){
|
||||||
cmatch what;
|
cmatch what;
|
||||||
try{
|
try{
|
||||||
regex_search(reinterpret_cast<const char*>(data), what, ele.second);
|
regex_search(reinterpret_cast<const char*>(data), reinterpret_cast<const char*>(data)+bytes_transferred, what, ele.second);
|
||||||
if(what.size() > 0){
|
if(what.size() > 0){
|
||||||
cout << "BLOCKED " << ele.first << endl;
|
cout << "BLOCKED " << ele.first << endl;
|
||||||
return false;
|
return false;
|
||||||
@@ -65,7 +65,7 @@ bool filter_data(unsigned char* data, const size_t& bytes_transferred, vector<pa
|
|||||||
for (pair<string,regex> ele:whitelist){
|
for (pair<string,regex> ele:whitelist){
|
||||||
cmatch what;
|
cmatch what;
|
||||||
try{
|
try{
|
||||||
regex_search(reinterpret_cast<const char*>(data), what, ele.second);
|
regex_search(reinterpret_cast<const char*>(data),reinterpret_cast<const char*>(data)+bytes_transferred, what, ele.second);
|
||||||
if(what.size() < 0){
|
if(what.size() < 0){
|
||||||
cout << "BLOCKED " << ele.first << endl;
|
cout << "BLOCKED " << ele.first << endl;
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user