From 51eaebf4f01ce8b8de4e32d679fe98b69ae64ad0 Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Sat, 29 Apr 2017 16:25:48 +0200 Subject: [PATCH] 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. --- sys/src/cmd/sshfs.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sys/src/cmd/sshfs.c b/sys/src/cmd/sshfs.c index cb5692d10..eaa32cb9d 100644 --- a/sys/src/cmd/sshfs.c +++ b/sys/src/cmd/sshfs.c @@ -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;