mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-10-19 04:34:04 -04: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:
1 parent
089ba29961
commit
5a1fca9347
1 file changed
+1
-1
@@ -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