up-polkit: Add G_ADD_PRIVATE (UpPolkit)

Without this, accesses to `UpPolkitPrivate` are actually out of bounds
and writing to it will cause heap corruption.

Fixes: https://gitlab.freedesktop.org/upower/upower/-/issues/281
This commit is contained in:
Jan Alexander Steffens (heftig) 2024-08-31 11:05:54 +02:00
parent b71996a526
commit b4697dbc62
No known key found for this signature in database
GPG key ID: B8AC08600F108CDF

View file

@ -43,7 +43,8 @@ struct UpPolkitPrivate
#endif
};
G_DEFINE_TYPE (UpPolkit, up_polkit, G_TYPE_OBJECT)
G_DEFINE_TYPE_WITH_CODE (UpPolkit, up_polkit, G_TYPE_OBJECT,
G_ADD_PRIVATE (UpPolkit))
static gpointer up_polkit_object = NULL;
#ifdef HAVE_POLKIT