* path.cc (readlink): Check if buffer length is positive. Truncate output to

buffer length.  Don't terminate buffer with '\0'.
This commit is contained in:
Christopher Faylor
2000-09-04 17:52:42 +00:00
parent 9c136d7ea6
commit f76325499a
14 changed files with 33 additions and 27 deletions

View File

@@ -178,8 +178,8 @@ search_for (uid_t uid, const char *name)
/* Return default passwd entry if passwd is emulated or it's a
request for the current user. */
if (passwd_state != loaded
|| (! name && uid == myself->uid)
|| ( name && strcasematch(name, myself->username)))
|| (!name && uid == myself->uid)
|| (name && strcasematch(name, myself->username)))
return default_pw;
return NULL;