@@ -988,7 +988,7 @@ UidList *Rlist2UidList(Rlist *uidnames, const Promise *pp)
988988 for (rp = uidnames ; rp != NULL ; rp = rp -> next )
989989 {
990990 username [0 ] = '\0' ;
991- uid = Str2Uid (RlistScalarValue (rp ), username , pp );
991+ uid = Str2Uid (RlistScalarValue (rp ), username , sizeof ( username ), pp );
992992 AddSimpleUidItem (& uidlist , uid , username );
993993 }
994994
@@ -1049,7 +1049,7 @@ GidList *Rlist2GidList(Rlist *gidnames, const Promise *pp)
10491049 for (rp = gidnames ; rp != NULL ; rp = rp -> next )
10501050 {
10511051 groupname [0 ] = '\0' ;
1052- gid = Str2Gid (RlistScalarValue (rp ), groupname , pp );
1052+ gid = Str2Gid (RlistScalarValue (rp ), groupname , sizeof ( groupname ), pp );
10531053 AddSimpleGidItem (& gidlist , gid , groupname );
10541054 }
10551055
@@ -1063,7 +1063,7 @@ GidList *Rlist2GidList(Rlist *gidnames, const Promise *pp)
10631063
10641064/*********************************************************************/
10651065
1066- uid_t Str2Uid (const char * uidbuff , char * usercopy , const Promise * pp )
1066+ uid_t Str2Uid (const char * uidbuff , char * usercopy , size_t copy_size , const Promise * pp )
10671067{
10681068 if (StringEqual (uidbuff , "*" ))
10691069 {
@@ -1126,7 +1126,7 @@ uid_t Str2Uid(const char *uidbuff, char *usercopy, const Promise *pp)
11261126 {
11271127 if (usercopy != NULL )
11281128 {
1129- strcpy (usercopy , uidbuff );
1129+ strlcpy (usercopy , uidbuff , copy_size );
11301130 }
11311131 }
11321132 else
@@ -1142,7 +1142,7 @@ uid_t Str2Uid(const char *uidbuff, char *usercopy, const Promise *pp)
11421142
11431143/*********************************************************************/
11441144
1145- gid_t Str2Gid (const char * gidbuff , char * groupcopy , const Promise * pp )
1145+ gid_t Str2Gid (const char * gidbuff , char * groupcopy , size_t copy_size , const Promise * pp )
11461146{
11471147 if (StringEqual (gidbuff , "*" ))
11481148 {
@@ -1169,7 +1169,7 @@ gid_t Str2Gid(const char *gidbuff, char *groupcopy, const Promise *pp)
11691169 {
11701170 if (groupcopy != NULL )
11711171 {
1172- strcpy (groupcopy , gidbuff );
1172+ strlcpy (groupcopy , gidbuff , copy_size );
11731173 }
11741174 }
11751175 else
0 commit comments