diff options
| author | sin <sin@2f30.org> | 2014-11-07 13:20:13 +0000 | 
|---|---|---|
| committer | sin <sin@2f30.org> | 2014-11-09 13:10:02 +0000 | 
| commit | 4339b507af01421e2deab63ca9ac3c5bdae5f4cc (patch) | |
| tree | 3b63f8444d7090ea08cfd5c32f69501dc87deeec | |
| parent | 8745098fa440ef3bf1d8e173dcd91514b34600c6 (diff) | |
| download | slock-4339b507af01421e2deab63ca9ac3c5bdae5f4cc.tar.gz slock-4339b507af01421e2deab63ca9ac3c5bdae5f4cc.zip | |
end{pw,sp}ent() can only be called after get{pw,sp}ent()
Calling them unconditionally can result in memory corruption.
| -rw-r--r-- | slock.c | 2 | 
1 files changed, 0 insertions, 2 deletions
| @@ -73,7 +73,6 @@ getpw(void) { /* only run as root */  		else  			die("slock: cannot retrieve password entry (make sure to suid or sgid slock)\n");  	} -	endpwent();  	rval =  pw->pw_passwd;  #if HAVE_SHADOW_H @@ -82,7 +81,6 @@ getpw(void) { /* only run as root */  		sp = getspnam(getenv("USER"));  		if(!sp)  			die("slock: cannot retrieve shadow entry (make sure to suid or sgid slock)\n"); -		endspent();  		rval = sp->sp_pwdp;  	}  #endif | 
