From 20ee0ec45677e4bcc1c475a866aba8aae2779d0b Mon Sep 17 00:00:00 2001 From: Disconnect3d Date: Tue, 22 Dec 2020 12:10:54 +0100 Subject: [PATCH] Fix off-by-one strncmp in e_sys_main.c TL;DR: The `LDR_` string has length of 4, but we compare only 3 bytes (instead of 4). This was found with a "cstrnfinder" research, so I haven't tested this or anything (more info https://twitter.com/disconnect3d_pl/status/1339757359896408065). --- src/bin/e_sys_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bin/e_sys_main.c b/src/bin/e_sys_main.c index abc2c3bffe..49c85a6579 100644 --- a/src/bin/e_sys_main.c +++ b/src/bin/e_sys_main.c @@ -224,7 +224,7 @@ main(int argc, if ((!strncmp(environ[i], "LD_", 3)) || (!strncmp(environ[i], "_RLD_", 5)) || (!strncmp(environ[i], "LC_", 3)) || - (!strncmp(environ[i], "LDR_", 3))) + (!strncmp(environ[i], "LDR_", 4))) { /* unset it */ tmp = strdup(environ[i]);