Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 658478da authored by Greg Kaiser's avatar Greg Kaiser
Browse files

lmkd: Adjust some buffer sizes/checks

LMKD_REPLY_MAX_SIZE was oversized by 8 bytes.  While not a cause of
bugs, this was a slight waste of space.  We're fixing this in
statslog.h (see the CL there for more details), and update this
value to keep in sync.

Additionally, KILL_OCCURRED_MSG_SIZE was undersized.  While we have
80 bytes worth of data from our memory_stat and kill_stat structs,
there's also, at a bare minimum, 4 bytes for our packet type, and
2 bytes for our process name string size.  If we don't have at
least 86 bytes here, our logKillOccurred() method will run out
of data to parse.

So in summary, this CL saves 8 bytes of memory, and will have us
now catch (rather unlikely) errors of messages between 80 and 85
bytes.

Bug: 405436516
Test: TreeHugger
Flag: EXEMPT bugfix
Change-Id: I6338a495cebb6e75034f699d83b110c950f6edc2
parent 02cefe53
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment