Fix crash reading invalid SIDs from passwd and group files
* grp.cc (pwdgrp::parse_group): Only copy the SID if it's valid.
        * passwd.cc (pwdgrp::parse_passwd): Ditto.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
			
			
This commit is contained in:
		| @@ -48,8 +48,8 @@ pwdgrp::parse_group () | ||||
|   /* Don't generate gr_mem entries. */ | ||||
|   grp.g.gr_mem = &null_ptr; | ||||
|   cygsid csid; | ||||
|   csid.getfromgr_passwd (&grp.g); | ||||
|   RtlCopySid (SECURITY_MAX_SID_SIZE, grp.sid, csid); | ||||
|   if (csid.getfromgr_passwd (&grp.g)) | ||||
|     RtlCopySid (SECURITY_MAX_SID_SIZE, grp.sid, csid); | ||||
|   return true; | ||||
| } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user