Skip to content

Commit

Permalink
pmc: Initialize reserved field in management_tlv_datum.
Browse files Browse the repository at this point in the history
The management_tlv_datum used in some SET commands is allocated
on stack, but nothing initialized the 8-bit reserved field. Set it to
zero to avoid sending uninitialized data.

Signed-off-by: Miroslav Lichvar <[email protected]>
  • Loading branch information
mlichvar authored and richardcochran committed Mar 1, 2022
1 parent f885fd8 commit 7553c09
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pmc_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@ static void do_set_action(struct pmc *pmc, int action, int index, char *str)
char onoff_port_state[4] = "off";
char onoff_time_status[4] = "off";

mtd.reserved = 0;

switch (action) {
case GET:
pmc_send_get_action(pmc, code);
Expand Down

0 comments on commit 7553c09

Please sign in to comment.