From: Tom Peters Date: Tue, 24 Feb 2015 22:25:58 +0000 (-0500) Subject: minor changes related to comments and a reg test problem X-Git-Tag: 3.0.0-233~1038^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2e86f51e697f2e7a5ba01aafc10f5f15c9e50df5;p=thirdparty%2Fsnort3.git minor changes related to comments and a reg test problem --- diff --git a/src/service_inspectors/http_inspect/hi_norm.cc b/src/service_inspectors/http_inspect/hi_norm.cc index ba064de45..a532878a0 100644 --- a/src/service_inspectors/http_inspect/hi_norm.cc +++ b/src/service_inspectors/http_inspect/hi_norm.cc @@ -73,15 +73,10 @@ typedef struct s_URI_NORM_STATE { - u_char *abs_uri; - u_char *param; - - /* - ** Directory tracking - */ + bool param; + // Directory tracking u_int dir_count; u_char *dir_track[MAX_DIRS]; - } URI_NORM_STATE; typedef int (*DECODE_FUNC)(HI_SESSION *, const u_char *, @@ -1340,7 +1335,7 @@ static inline int InspectUriChar(HI_SESSION *session, int iChar, { // This is the end of the path field. Check for a long directory following. CheckLongDir(session, norm_state, *ub_ptr); - norm_state->param = *ub_ptr; + norm_state->param = (*ub_ptr != NULL); } **ub_ptr = (u_char)iDir; @@ -1354,7 +1349,7 @@ static inline int InspectUriChar(HI_SESSION *session, int iChar, { // This is the end of the path field. Check for a long directory following. CheckLongDir(session, norm_state, *ub_ptr); - norm_state->param = *ub_ptr; + norm_state->param = (*ub_ptr != NULL); } /* @@ -1426,7 +1421,7 @@ int hi_norm_uri(HI_SESSION *session, u_char *uribuf, int *uribuf_size, ** Initialize the URI directory normalization state */ norm_state.dir_count = 0; - norm_state.param = NULL; + norm_state.param = false; while(hi_util_in_bounds(ub_start, ub_end, ub_ptr)) {