Skip to content
Commit 73064619 authored by Tao Bao's avatar Tao Bao
Browse files

updater: Don't zero out CommandParameters with memset(3).

[1] switched a few things to android::base::unique_fd including
CommandParameters.fd. However, we were using memset(3) to zero out the
struct, which effectively assigned unique_fd(0) to fd. When it called
fd.reset(), file descriptor 0 was unintentionally closed. When FD 0 was
later reassigned via open(2), it led to lseek(2) errors: "Bad file
descriptor".

This CL switches to using braced-init (i.e. '= {}') instead, so that the
default constructor unique_fd(-1) would be called.

[1]: commit bcabd092

Bug: 28391985
Change-Id: If1f99932b15552714c399e65c8b80550344b758a
parent a1f4a1ec
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment