]> granicus.if.org Git - sudo/commitdiff
Don't write to sbp if it is NULL
authorTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 17 Nov 2011 21:33:32 +0000 (16:33 -0500)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 17 Nov 2011 21:33:32 +0000 (16:33 -0500)
plugins/sudoers/goodpath.c

index d0c6df9e288910f7043f0c08ad2f5ebad260e011..09fb765108a4fe14ebe81329e9633947d0fb60c4 100644 (file)
@@ -54,7 +54,8 @@ sudo_goodpath(const char *path, struct stat *sbp)
            rval = TRUE;
        else
            errno = EACCES;
-       (void) memcpy(sbp, &sb, sizeof(struct stat));
+       if (sbp)
+           (void) memcpy(sbp, &sb, sizeof(struct stat));
     }
 
     debug_return_int(rval);