sshfs: don't crash when no /etc/password file could be read on the remote side

in a cygwin environment, theres no /etc/passwd file to
translate numeric uid/gid's. changing passwdparse() to
ignore nil string argument.
This commit is contained in:
cinap_lenrek 2017-04-29 16:25:48 +02:00
parent f00488ec70
commit 51eaebf4f0

View file

@ -1252,13 +1252,13 @@ out:
void
passwdparse(IDEnt **tab, char *s)
{
char *p;
char *n;
int id;
IDEnt *e, **b;
char *p, *n;
int id;
p = s;
for(;;){
if(s == nil)
return;
for(p = s;;){
n = p;
p = strpbrk(p, ":\n"); if(p == nil) break; if(*p != ':'){ p++; continue; }
*p = 0;