[PATCH] procd: jail/jail: correctly check for null pointer

Philipp Meier Philipp.Meier at westermo.com
Tue Nov 8 06:26:47 PST 2022


Author: Philipp Meier <philipp.meier at westermo.com>
Date:   Tue Nov 8 14:38:37 2022 +0100

    procd: jail/jail: correctly check for null pointer
    
    Handle case where opts.sysctl is not used.
    
    Signed-off-by: Philipp Meier <philipp.meier at westermo.com>

diff --git a/jail/jail.c b/jail/jail.c
index ce6b268..31b64e5 100644
--- a/jail/jail.c
+++ b/jail/jail.c
@@ -215,6 +215,10 @@ static void free_hooklist(struct hook_execvpe **hooklist)
 
 static void free_sysctl(void) {
        struct sysctl_val *cur;
+
+       if (!opts.sysctl)
+               return;
+
        cur = *opts.sysctl;
 
        while (cur) {



More information about the openwrt-devel mailing list