mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2025-12-20 04:40:02 +01:00
xwayland: Fix search of duplicate lease names
Commitd36f66f15d("Check for duplicate output names") would walk the list of existing outputs and leases to check that no other existing output has the same name. The change however, inadvertently reused the regular screen outputs when searching the leased names. Fix this by using the lease name, not the regular output names that we already checked just above. Found by SAST tool Svace. Fixes:d36f66f15d- xwayland: Check for duplicate output names Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1843 Reviewed-by Olivier Fourdan <ofourdan@redhat.com> Signed-off-by: Mikhail Dmitrichenko <m.dmitrichenko222@gmail.com> Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2063>
This commit is contained in:
parent
bcc0587ab9
commit
b096785df4
1 changed files with 1 additions and 1 deletions
|
|
@ -721,7 +721,7 @@ xwl_output_set_name(struct xwl_output *xwl_output, const char *name)
|
|||
/* And leases' names as well */
|
||||
xorg_list_for_each_entry(lease, &pScrPriv->leases, list) {
|
||||
for (i = 0; i < lease->numOutputs; i++) {
|
||||
if (!strcmp(name, pScrPriv->outputs[i]->name)) {
|
||||
if (!strcmp(name, lease->outputs[i]->name)) {
|
||||
ErrorF("A lease output named '%s' already exists", name);
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue