mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-03-02 05:18:55 -05:00
linux-capture: Fix potential null pointer dereference
Use dstr_cmp() instead of strcmp() to prevent null pointer dereferences. This code for this source has way too many pointers.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user