window: Initialize rect

As far as I can see this doesn't happen in practice, but theoretically
the uninitialized values can be used if:

 1. `did_placement` is TRUE
 2. `flags` contains both `META_MOVE_RESIZE_RESIZE_ACTION` and
    also `META_MOVE_RESIZE_MOVE_ACTION`
 3. `!meta_window_is_tied_to_drag (window)` is FALSE

In that case, the `frame_rect` variable (with uninitialized values) is
passed to `unconstrained_rect`, then passed to `constrained_rect`,
then finally the (uninitialized) X and Y values are read in the
`if (did_placement)` branch.

This is probably a regression from 3047b2ce261. I don't know if this is
the appropriate fix.

Coverity CID: #1511378

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4175>
This commit is contained in:
Georges Basile Stavracas Neto 2024-12-09 22:33:19 -03:00
parent c6ecaf01c2
commit 0265fa34be

View File

@ -4375,14 +4375,14 @@ adjust_size_for_tile_match (MetaWindow *window,
}
void
meta_window_resize_frame_with_gravity (MetaWindow *window,
meta_window_resize_frame_with_gravity (MetaWindow *window,
gboolean user_op,
int w,
int h,
MetaGravity gravity)
{
MetaMoveResizeFlags flags;
MtkRectangle rect;
MtkRectangle rect = { 0, };
rect.width = w;
rect.height = h;