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

Commit 47725e6a authored by Suren Baghdasaryan's avatar Suren Baghdasaryan Committed by android-build-merger
Browse files

Merge "lmkd: Protect against buffer overflow" am: 41950dd4 am: 26beb5ca

am: 904648c7

Change-Id: I228e23a33957da600e3389b2cd32c47bf890439d
parents 96fa095c 904648c7
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -82,6 +82,9 @@
/* Defined as ProcessList.SYSTEM_ADJ in ProcessList.java */
#define SYSTEM_ADJ (-900)

#define STRINGIFY(x) STRINGIFY_INTERNAL(x)
#define STRINGIFY_INTERNAL(x) #x

/* default to old in-kernel interface if no memory pressure events */
static bool use_inkernel_interface = true;
static bool has_inkernel_module;
@@ -730,10 +733,10 @@ static void ctrl_connect_handler(int data __unused, uint32_t events __unused) {

#ifdef LMKD_LOG_STATS
static void memory_stat_parse_line(char *line, struct memory_stat *mem_st) {
    char key[LINE_MAX];
    char key[LINE_MAX + 1];
    int64_t value;

    sscanf(line,"%s  %" SCNd64 "", key, &value);
    sscanf(line, "%" STRINGIFY(LINE_MAX) "s  %" SCNd64 "", key, &value);

    if (strcmp(key, "total_") < 0) {
        return;