]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
lib/env.c: sanitize_env(): Use !strprefix() instead of its pattern
authorAlejandro Colomar <alx@kernel.org>
Tue, 10 Dec 2024 04:10:02 +0000 (05:10 +0100)
committerSerge Hallyn <serge@hallyn.com>
Mon, 26 May 2025 16:29:26 +0000 (11:29 -0500)
Signed-off-by: Alejandro Colomar <alx@kernel.org>
lib/env.c

index df1a2c08a78f26260d598e72286d379f8d64e769..9a21a368e0a47de58eec4f63f705811a567255e0 100644 (file)
--- a/lib/env.c
+++ b/lib/env.c
@@ -223,7 +223,7 @@ void sanitize_env (void)
 
        for (cur = envp; NULL != *cur; cur++) {
                for (bad = noslash; NULL != *bad; bad++) {
-                       if (strncmp (*cur, *bad, strlen (*bad)) != 0) {
+                       if (!strprefix(*cur, *bad)) {
                                continue;
                        }
                        if (strchr (*cur, '/') == NULL) {