mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-24 13:24:56 +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;
|
gid_t gid;
|
||||||
|
|
||||||
if( getpeereid( s, &uid, &gid ) == 0 ) {
|
if( getpeereid( s, &uid, &gid ) == 0 ) {
|
||||||
authid = ch_malloc( sizeof("uidNumber=+gidNumber=+,"
|
authid = ch_malloc(
|
||||||
"cn=peercred,cn=external,cn=auth") + 32);
|
sizeof("uidNumber=XXXXXX+gidNumber=XXXXXX,"
|
||||||
|
"cn=peercred,cn=external,cn=auth"));
|
||||||
sprintf(authid, "uidNumber=%d+gidNumber=%d,"
|
sprintf(authid, "uidNumber=%d+gidNumber=%d,"
|
||||||
"cn=peercred,cn=external,cn=auth",
|
"cn=peercred,cn=external,cn=auth",
|
||||||
uid, gid);
|
uid, gid);
|
||||||
|
Loading…
Reference in New Issue
Block a user