Skip to content

Commit 3dc5ff5

Browse files
author
Marc Stern
committed
remove useless memset
1 parent 11f85b8 commit 3dc5ff5

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

apache2/re_operators.c

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -630,35 +630,25 @@ static int msre_op_rsub_execute(modsec_rec *msr, msre_rule *rule, msre_var *var,
630630
}
631631

632632
if(msr->stream_input_data != NULL && input_body == 1) {
633-
memset(msr->stream_input_data, 0x0, msr->stream_input_length);
634633
free(msr->stream_input_data);
635634
msr->stream_input_data = NULL;
636635
msr->stream_input_length = 0;
637636
#ifdef MSC_LARGE_STREAM_INPUT
638637
msr->stream_input_allocated_length = 0;
639-
640-
msr->stream_input_data = (char *)malloc(size);
641-
#else
642-
msr->stream_input_data = (char *)malloc(size+1);
643638
#endif
644-
639+
msr->stream_input_data = (char *)malloc(size+1);
645640
if(msr->stream_input_data == NULL) {
646641
return -1;
647642
}
648643

649644
msr->stream_input_length = size;
650645
#ifdef MSC_LARGE_STREAM_INPUT
651646
msr->stream_input_allocated_length = size;
652-
memset(msr->stream_input_data, 0x0, size);
653-
#else
654-
memset(msr->stream_input_data, 0x0, size+1);
655647
#endif
656648
msr->if_stream_changed = 1;
657649

658650
memcpy(msr->stream_input_data, data, size);
659-
#ifndef MSC_LARGE_STREAM_INPUT
660651
msr->stream_input_data[size] = '\0';
661-
#endif
662652

663653
var->value_len = size;
664654
var->value = msr->stream_input_data;

0 commit comments

Comments
 (0)