logind: zero-initialize dispatch struct in vl_method_release_session()

The local struct passed to sd_varlink_dispatch() was not
zero-initialized. Since sd_json_dispatch_full() does not call handlers
for absent optional fields, p.id could be left indeterminate when
the client omits the Id parameter, leading to use of uninitialized
memory.
This commit is contained in:
Yaping Li
2026-05-13 07:47:18 +09:00
committed by Yu Watanabe
parent 98d061e28b
commit eda10260a0
+1 -1
View File
@@ -310,7 +310,7 @@ static int vl_method_release_session(sd_varlink *link, sd_json_variant *paramete
struct {
const char *id;
} p;
} p = {};
static const sd_json_dispatch_field dispatch_table[] = {
{ "Id", SD_JSON_VARIANT_STRING, sd_json_dispatch_const_string, voffsetof(p, id), 0 },