]> granicus.if.org Git - sudo/commitdiff
Fix potential NULL pointer deref found by cppcheck.
authorTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 14 Nov 2014 23:31:56 +0000 (16:31 -0700)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 14 Nov 2014 23:31:56 +0000 (16:31 -0700)
plugins/sudoers/iolog_path.c

index 4fac617ed3535238253be2538055cdc8288af22c..1356b0b4afb6f1cd0c2cf3576aae400513c08bde 100644 (file)
@@ -275,9 +275,10 @@ expand_iolog_path(const char *prefix, const char *dir, const char *file,
            *dst = '\0';
        }
     }
-    if (slashp)
+    if (slash != NULL)
+       *slash = '/';
+    if (slashp != NULL)
        *slashp = slash;
-    *slash = '/';
 
     debug_return_str(path);
 bad: