Skip to content

Commit

Permalink
linux-capture: Fix potential null pointer dereference
Browse files Browse the repository at this point in the history
Use dstr_cmp() instead of strcmp() to prevent null pointer dereferences.

This code for this source has way too many pointers.
  • Loading branch information
Lain-B committed Oct 5, 2024
1 parent 089ba29 commit 5a1fca9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plugins/linux-capture/xcomposite-input.c
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ xcb_window_t xcomp_find_window(xcb_connection_t *conn, Display *disp, const char

struct dstr cwname = xcomp_window_name(conn, disp, cwin);
struct dstr cwcls = xcomp_window_class(conn, cwin);
bool found = strcmp(wname, cwname.array) == 0 && strcmp(wcls, cwcls.array) == 0;
bool found = dstr_cmp(&cwname, wname) == 0 && dstr_cmp(&cwcls, wcls) == 0;

dstr_free(&cwname);
dstr_free(&cwcls);
Expand Down

0 comments on commit 5a1fca9

Please sign in to comment.