Skip to content

Commit ba8559a

Browse files
committed
Remove the unneeded null termination for the stream_input_data
1 parent 16c2fcc commit ba8559a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

apache2/re_operators.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -636,15 +636,15 @@ static int msre_op_rsub_execute(modsec_rec *msr, msre_rule *rule, msre_var *var,
636636
msr->stream_input_length = 0;
637637
msr->stream_input_allocated_length = 0;
638638

639-
msr->stream_input_data = (char *)malloc(size+1);
639+
msr->stream_input_data = (char *)malloc(size);
640640

641641
if(msr->stream_input_data == NULL) {
642642
return -1;
643643
}
644644

645645
msr->stream_input_length = size;
646-
msr->stream_input_allocated_length = size + 1;
647-
memset(msr->stream_input_data, 0x0, size + 1);
646+
msr->stream_input_allocated_length = size;
647+
memset(msr->stream_input_data, 0x0, size);
648648

649649
msr->if_stream_changed = 1;
650650

0 commit comments

Comments
 (0)