Skip to content

Commit

Permalink
fixup! app-layer: improve limits on number of probing parsers
Browse files Browse the repository at this point in the history
  • Loading branch information
catenacyber committed Nov 12, 2024
1 parent 850da3c commit fe23001
Showing 1 changed file with 3 additions and 22 deletions.
25 changes: 3 additions & 22 deletions src/app-layer-detect-proto.c
Original file line number Diff line number Diff line change
Expand Up @@ -862,15 +862,12 @@ static void AppLayerProtoDetectPrintProbingParsers(AppLayerProtoDetectProbingPar
if (pp_port->dp != NULL) {
printf(" Port: %"PRIu16 "\n", pp_port->port);

printf(" Destination port: (max-depth: %"PRIu16 ", "
"mask - %"PRIu32")\n",
pp_port->dp_max_depth,
pp_port->alproto_mask);
printf(" Destination port: (max-depth: %" PRIu16 ")\n",
pp_port->dp_max_depth);
pp_pe = pp_port->dp;
for ( ; pp_pe != NULL; pp_pe = pp_pe->next) {

printf(" alproto: %s\n", AppProtoToString(pp_pe->alproto));
printf(" mask: %"PRIu32 "\n", pp_pe->alproto_mask);
printf(" min_depth: %"PRIu32 "\n", pp_pe->min_depth);
printf(" max_depth: %"PRIu32 "\n", pp_pe->max_depth);

Expand All @@ -882,15 +879,11 @@ static void AppLayerProtoDetectPrintProbingParsers(AppLayerProtoDetectProbingPar
continue;
}

printf(" Source port: (max-depth: %"PRIu16 ", "
"mask - %"PRIu32")\n",
pp_port->sp_max_depth,
pp_port->alproto_mask);
printf(" Source port: (max-depth: %" PRIu16 ")\n", pp_port->sp_max_depth);
pp_pe = pp_port->sp;
for ( ; pp_pe != NULL; pp_pe = pp_pe->next) {

printf(" alproto: %s\n", AppProtoToString(pp_pe->alproto));
printf(" mask: %"PRIu32 "\n", pp_pe->alproto_mask);
printf(" min_depth: %"PRIu32 "\n", pp_pe->min_depth);
printf(" max_depth: %"PRIu32 "\n", pp_pe->max_depth);

Expand Down Expand Up @@ -2867,14 +2860,12 @@ typedef struct AppLayerProtoDetectPPTestDataElement_ {
const char *alproto_name;
AppProto alproto;
uint16_t port;
uint32_t alproto_mask;
uint32_t min_depth;
uint32_t max_depth;
} AppLayerProtoDetectPPTestDataElement;

typedef struct AppLayerProtoDetectPPTestDataPort_ {
uint16_t port;
uint32_t alproto_mask;
uint16_t dp_max_depth;
uint16_t sp_max_depth;

Expand Down Expand Up @@ -2909,10 +2900,6 @@ static int AppLayerProtoDetectPPTestData(AppLayerProtoDetectProbingParser *pp,
for (k = 0; k < ip_proto[i].no_of_port; k++, pp_port = pp_port->next) {
if (pp_port->port != ip_proto[i].port[k].port)
goto end;
if (pp_port->alproto_mask != ip_proto[i].port[k].alproto_mask)
goto end;
if (pp_port->alproto_mask != ip_proto[i].port[k].alproto_mask)
goto end;
if (pp_port->dp_max_depth != ip_proto[i].port[k].dp_max_depth)
goto end;
if (pp_port->sp_max_depth != ip_proto[i].port[k].sp_max_depth)
Expand All @@ -2928,9 +2915,6 @@ static int AppLayerProtoDetectPPTestData(AppLayerProtoDetectProbingParser *pp,
if (pp_element->alproto != ip_proto[i].port[k].toserver_element[j].alproto) {
goto end;
}
if (pp_element->alproto_mask != ip_proto[i].port[k].toserver_element[j].alproto_mask) {
goto end;
}
if (pp_element->min_depth != ip_proto[i].port[k].toserver_element[j].min_depth) {
goto end;
}
Expand All @@ -2949,9 +2933,6 @@ static int AppLayerProtoDetectPPTestData(AppLayerProtoDetectProbingParser *pp,
if (pp_element->alproto != ip_proto[i].port[k].toclient_element[j].alproto) {
goto end;
}
if (pp_element->alproto_mask != ip_proto[i].port[k].toclient_element[j].alproto_mask) {
goto end;
}
if (pp_element->min_depth != ip_proto[i].port[k].toclient_element[j].min_depth) {
goto end;
}
Expand Down

0 comments on commit fe23001

Please sign in to comment.