aboutsummaryrefslogtreecommitdiff
path: root/example
diff options
context:
space:
mode:
authorLuca Deri <deri@ntop.org>2020-05-16 00:10:35 +0200
committerLuca Deri <deri@ntop.org>2020-05-16 00:10:35 +0200
commit3d9285f1be84db7ecec821b75f67964dc4773a65 (patch)
treee88b21c20d28baaea0b371849242d5c4648eb3a9 /example
parentc375782b96faf30558b3f91a7fe05eae62fc79c2 (diff)
Added check for invalid HTTP URLs
Diffstat (limited to 'example')
-rw-r--r--example/ndpiReader.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/example/ndpiReader.c b/example/ndpiReader.c
index 83144b46e..990b0264e 100644
--- a/example/ndpiReader.c
+++ b/example/ndpiReader.c
@@ -1199,10 +1199,10 @@ static void printFlow(u_int16_t id, struct ndpi_flow_info *flow, u_int16_t threa
}
if(flow->http.url[0] != '\0') {
- u_int16_t risk = ndpi_validate_url(flow->http.url);
+ ndpi_risk_enum risk = ndpi_validate_url(flow->http.url);
if(risk != NDPI_NO_RISK)
- flow->risk |= risk;
+ NDPI_SET_BIT(flow->risk, risk);
fprintf(out, "[URL: %s[StatusCode: %u]",
flow->http.url, flow->http.response_status_code);
@@ -3046,13 +3046,13 @@ void test_lib() {
static void bitmapUnitTest() {
u_int32_t val, i, j;
- for(i=0; i<16; i++) {
- val = 0;
+ for(i=0; i<32; i++) {
+ NDPI_ZERO_BIT(val);
NDPI_SET_BIT(val, i);
assert(NDPI_ISSET_BIT(val, i));
- for(j=0; j<16; j++) {
+ for(j=0; j<32; j++) {
if(j != i) {
assert(!NDPI_ISSET_BIT(val, j));
}