Skip to content

Commit

Permalink
tools: ts_uinput: allocate enough memory for null terminating string
Browse files Browse the repository at this point in the history
  • Loading branch information
merge committed Dec 5, 2016
1 parent 6ebcdc3 commit 733eead
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/ts_uinput.c
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ int main(int argc, char **argv)
}

if (!data.uinput_name) {
data.uinput_name = malloc(strlen(DEFAULT_UINPUT_NAME));
data.uinput_name = malloc(strlen(DEFAULT_UINPUT_NAME) + 1);
if (!data.uinput_name)
return errno;
sprintf(data.uinput_name, DEFAULT_UINPUT_NAME);
Expand Down

0 comments on commit 733eead

Please sign in to comment.