diff --git a/.gitignore b/.gitignore index 1f9b508..e420459 100644 --- a/.gitignore +++ b/.gitignore @@ -6,7 +6,7 @@ Debug .project .settings/ SI -build/ +build*/ src/inc src/lib64 cmake-build-*/ diff --git a/src/quic_process.cpp b/src/quic_process.cpp index 4b677c6..076001e 100644 --- a/src/quic_process.cpp +++ b/src/quic_process.cpp @@ -100,6 +100,12 @@ static int copy_extension_tag(const char *tag_start_pos, int tag_len, char **out { if(tag_start_pos!=NULL && tag_len>0) { + if(*out!=NULL) + { + dictator_free(thread_seq, *out); + *out=NULL; + } + (*out)=(char *)dictator_malloc(thread_seq, tag_len+1); memcpy(*out, tag_start_pos, tag_len); (*out)[tag_len]='\0'; @@ -310,9 +316,12 @@ int parse_special_frame_stream(struct quic_info* quic_info, const char *payload, return PARSE_RESULT_VERSION; } - quic_info->client_hello=(struct quic_client_hello *)dictator_malloc(thread_seq, sizeof(struct quic_client_hello)); - memset(quic_info->client_hello, 0, sizeof(struct quic_client_hello)); - + if(quic_info->client_hello==NULL) + { + quic_info->client_hello=(struct quic_client_hello *)dictator_malloc(thread_seq, sizeof(struct quic_client_hello)); + memset(quic_info->client_hello, 0, sizeof(struct quic_client_hello)); + } + tag_value_start_offset=payload_offset+tag_num*4*2; // skip length of type and offset, type(offset)=szieof(int) while(tag_num>pass_tag_num)