dtsession/SmLock: potential null deref (CID 87561, 87957, 88181)
authorJon Trulson <jon@radscan.com>
Sat, 27 Dec 2014 23:06:23 +0000 (16:06 -0700)
committerJon Trulson <jon@radscan.com>
Sat, 27 Dec 2014 23:06:23 +0000 (16:06 -0700)
cde/programs/dtsession/SmLock.c

index 25069851ead5e2ed710741f82c4ae6283b189933..fb45d37c8070df3a328202ba6b7f252caff2de00 100644 (file)
@@ -162,7 +162,8 @@ static Boolean CanReAuthenticate(char *name, uid_t uid, char *passwd,
   Boolean fail = False;
 
   *pwent = (name == NULL) ? getpwuid(uid) : getpwnam(name);
-  *spent = getspnam((*pwent)->pw_name);
+  if (pwent)
+    *spent = getspnam((*pwent)->pw_name);
 
 #ifdef JET_AUTHDEBUG
   fprintf(stderr, "CanReAuthenticate(): %s %s %s\n",