From: Todd C. Miller Date: Thu, 17 Nov 2011 21:33:32 +0000 (-0500) Subject: Don't write to sbp if it is NULL X-Git-Tag: SUDO_1_8_4~150^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c189fa5f55531430674c3fd84d2ef6462da9c93b;p=sudo Don't write to sbp if it is NULL --- diff --git a/plugins/sudoers/goodpath.c b/plugins/sudoers/goodpath.c index d0c6df9e2..09fb76510 100644 --- a/plugins/sudoers/goodpath.c +++ b/plugins/sudoers/goodpath.c @@ -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);