ip/cifsd: limit response data count in TRANS2 for remotebuffersize, avoid empty filename for the root
This commit is contained in:
parent
e684b2a3fb
commit
40f6e00b9c
|
@ -65,8 +65,11 @@ xdirstat0(char **path, int (*namecmp)(char *, char *), char *err)
|
||||||
Dir *d, *t;
|
Dir *d, *t;
|
||||||
int n, i;
|
int n, i;
|
||||||
|
|
||||||
if(d = dirstat(*path))
|
if(d = dirstat(*path)){
|
||||||
|
if(d->name[0] == 0)
|
||||||
|
d->name = "/";
|
||||||
return d;
|
return d;
|
||||||
|
}
|
||||||
if(!splitpath(*path, &base, &name))
|
if(!splitpath(*path, &base, &name))
|
||||||
return nil;
|
return nil;
|
||||||
if((n = xdirread0(&base, namecmp, &t)) < 0)
|
if((n = xdirread0(&base, namecmp, &t)) < 0)
|
||||||
|
|
|
@ -1614,8 +1614,11 @@ unsup:
|
||||||
goto unsup;
|
goto unsup;
|
||||||
}
|
}
|
||||||
if(57+((rsc+1)&~1)+((rpc+3)&~3)+((rdc+3)&~3) > remotebuffersize){
|
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);
|
rdc = remotebuffersize-(57+((rsc+1)&~1)+((rpc+3)&~3)) & ~3;
|
||||||
goto unsup;
|
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;
|
t.in.param.b = t.in.param.p = pa; t.in.param.e = pe;
|
||||||
|
|
Loading…
Reference in a new issue