Skip to content

Commit ea42f99

Browse files
committed
bsim_standalone: Fix buffer overflow when using -V flag
1 parent 902302f commit ea42f99

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

util/bsim_standalone/main.cxx.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ parse_cmd_line_args (int argc, char *argv [],
6868
char *p_src = optarg;
6969
if (optarg == NULL)
7070
p_src = & ( vcdfile_default [0] );
71-
int len = strlen (p_src);
71+
int len = strlen (p_src) + 1;
7272
char *p = (char *) malloc (len);
7373
if (p == NULL) {
7474
fprintf (stderr,

0 commit comments

Comments
 (0)