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
Loading
Please register or sign in to comment