Accuracy, not strong test length of string in strschg_environ
This commit is contained in:
parent
ed63c97cc0
commit
bc54b3f3b3
@ -95,7 +95,7 @@ int strschg_environ(std::string& s) {
|
||||
const char *p = s.c_str()+1;
|
||||
struct passwd *pe=NULL;
|
||||
|
||||
if((s.length() != 1) and not isslash(*p)) {
|
||||
if((s.length() > 1) and not isslash(*p)) {
|
||||
while(*p and not isslash(*p))
|
||||
name += *p++;
|
||||
pe = getpwnam(name.c_str());
|
||||
|
Reference in New Issue
Block a user