Skip to content

Comments

host_cmd: zero-initialize response buffer#215

Merged
rkr35 merged 1 commit intogoogle:mainfrom
rkr35:init-resp
Feb 25, 2026
Merged

host_cmd: zero-initialize response buffer#215
rkr35 merged 1 commit intogoogle:mainfrom
rkr35:init-resp

Conversation

@rkr35
Copy link
Collaborator

@rkr35 rkr35 commented Feb 25, 2026

Unit tests that don't appropriately mock host command responses in libhoth_receive_response will cause resp.hdr and resp.payload_buf to be uninitialized.

Using resp in

  status = validate_ec_response_header(&resp.hdr, resp.payload_buf, resp_size);

will access uninitialized memory.

@rkr35 rkr35 marked this pull request as ready for review February 25, 2026 00:31
Unit tests that don't appropriately mock host command responses in
`libhoth_receive_response` will cause `resp.hdr` and `resp.payload_buf` to be
uninitialized.

Using `resp` in

```c
  status = validate_ec_response_header(&resp.hdr, resp.payload_buf, resp_size);
```

will access uninitialized memory.
@rkr35 rkr35 merged commit f4fc0d8 into google:main Feb 25, 2026
5 checks passed
@rkr35 rkr35 deleted the init-resp branch February 25, 2026 01:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants