summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/src/cmd/ip/cifsd/dir.c5
-rw-r--r--sys/src/cmd/ip/cifsd/smb.c7
2 files changed, 9 insertions, 3 deletions
diff --git a/sys/src/cmd/ip/cifsd/dir.c b/sys/src/cmd/ip/cifsd/dir.c
index 65707bcb8..7b6c013aa 100644
--- a/sys/src/cmd/ip/cifsd/dir.c
+++ b/sys/src/cmd/ip/cifsd/dir.c
@@ -65,8 +65,11 @@ xdirstat0(char **path, int (*namecmp)(char *, char *), char *err)
Dir *d, *t;
int n, i;
- if(d = dirstat(*path))
+ if(d = dirstat(*path)){
+ if(d->name[0] == 0)
+ d->name = "/";
return d;
+ }
if(!splitpath(*path, &base, &name))
return nil;
if((n = xdirread0(&base, namecmp, &t)) < 0)
diff --git a/sys/src/cmd/ip/cifsd/smb.c b/sys/src/cmd/ip/cifsd/smb.c
index 3dbf57b53..af2182097 100644
--- a/sys/src/cmd/ip/cifsd/smb.c
+++ b/sys/src/cmd/ip/cifsd/smb.c
@@ -1614,8 +1614,11 @@ unsup:
goto unsup;
}
if(57+((rsc+1)&~1)+((rpc+3)&~3)+((rdc+3)&~3) > remotebuffersize){
- logit("[%.4x] %s response doesnt fit in client buffer", t.cmd, t.name);
- goto unsup;
+ rdc = remotebuffersize-(57+((rsc+1)&~1)+((rpc+3)&~3)) & ~3;
+ if(rdc <= 0){
+ logit("[%.4x] %s response doesnt fit in client buffer", t.cmd, t.name);
+ goto unsup;
+ }
}
t.in.param.b = t.in.param.p = pa; t.in.param.e = pe;