From 95978943564845ce4340c34fab567716a15fce6e Mon Sep 17 00:00:00 2001 From: Jordan Bancino Date: Thu, 17 Nov 2022 19:33:59 +0000 Subject: [PATCH] Fix some warnings on GCC. These aren't really anything to be concerned about, but making GCC feel good about my code makes me feel better about my code. --- src/Telodendria.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Telodendria.c b/src/Telodendria.c index 5907e6e..3e593cd 100644 --- a/src/Telodendria.c +++ b/src/Telodendria.c @@ -143,8 +143,8 @@ main(int argc, char **argv) TelodendriaConfig *tConfig = NULL; /* User validation */ - struct passwd *userInfo; - struct group *groupInfo; + struct passwd *userInfo = NULL; + struct group *groupInfo = NULL; /* Signal handling */ struct sigaction sigAction; @@ -395,7 +395,7 @@ main(int argc, char **argv) Log(lc, LOG_WARNING, "Unable to chroot into directory: %s.", tConfig->dataDir); } - if (tConfig->uid && tConfig->gid) + if (userInfo && groupInfo) { if (setgid(groupInfo->gr_gid) != 0 || setuid(userInfo->pw_uid) != 0) {