From a1b0469cb7036867c606466aa7c30187289900b4 Mon Sep 17 00:00:00 2001 From: Assar Westerlund Date: Sat, 3 Jun 2000 12:56:44 +0000 Subject: [PATCH] (doit): check return value of getspnam. From git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@8309 ec53bebd-3082-4978-b11e-865c3cabbd6b --- appl/rsh/rshd.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/appl/rsh/rshd.c b/appl/rsh/rshd.c index b60da3156..7188bca25 100644 --- a/appl/rsh/rshd.c +++ b/appl/rsh/rshd.c @@ -664,10 +664,12 @@ doit (int do_kerberos, int check_rhosts) long today; sp = getspnam(server_user); - today = time(0)/(24L * 60 * 60); - if (sp->sp_expire > 0) - if (today > sp->sp_expire) - fatal(s, "Account has expired."); + if (sp != NULL) { + today = time(0)/(24L * 60 * 60); + if (sp->sp_expire > 0) + if (today > sp->sp_expire) + fatal(s, "Account has expired."); + } } #endif