mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-06 10:46:21 +08:00
Avoid magic constant (32) in allocation. Use sizeof instead
This commit is contained in:
parent
840e7f2c5c
commit
7c4445aed4
@ -1560,8 +1560,9 @@ slapd_daemon_task(
|
||||
gid_t gid;
|
||||
|
||||
if( getpeereid( s, &uid, &gid ) == 0 ) {
|
||||
authid = ch_malloc( sizeof("uidNumber=+gidNumber=+,"
|
||||
"cn=peercred,cn=external,cn=auth") + 32);
|
||||
authid = ch_malloc(
|
||||
sizeof("uidNumber=XXXXXX+gidNumber=XXXXXX,"
|
||||
"cn=peercred,cn=external,cn=auth"));
|
||||
sprintf(authid, "uidNumber=%d+gidNumber=%d,"
|
||||
"cn=peercred,cn=external,cn=auth",
|
||||
uid, gid);
|
||||
|
Loading…
Reference in New Issue
Block a user