Skip to content

Commit

Permalink
Check for nullptr in tsm_vte_get_flags
Browse files Browse the repository at this point in the history
  • Loading branch information
Aetf authored and Aetf committed Sep 20, 2022
1 parent 2c8ba7b commit d66dd16
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/tsm/tsm-vte.c
Original file line number Diff line number Diff line change
Expand Up @@ -593,6 +593,10 @@ void tsm_vte_get_def_attr(struct tsm_vte *vte, struct tsm_screen_attr *out)
SHL_EXPORT
unsigned int tsm_vte_get_flags(struct tsm_vte *vte)
{
if (!vte) {
return 0;
}

return vte->flags;
}

Expand Down
1 change: 1 addition & 0 deletions test/test_vte.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ START_TEST(test_vte_null)
ck_assert_int_eq(r, -EINVAL);

tsm_vte_get_def_attr(NULL, NULL);
tsm_vte_get_flags(NULL);

tsm_vte_get_mouse_mode(NULL);
tsm_vte_get_mouse_event(NULL);
Expand Down

0 comments on commit d66dd16

Please sign in to comment.