Commit 7c4445ae authored by Kurt Zeilenga's avatar Kurt Zeilenga
Browse files

Avoid magic constant (32) in allocation. Use sizeof instead

parent 840e7f2c
......@@ -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);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment