mirror of
https://github.com/samba-team/samba.git
synced 2025-01-11 05:18:09 +03:00
samdb: Fix an uninitialized variable read
When the "(status == LDB_SUCCESS && msg != NULL)" condition in this routine is not evaluating to true, "new_rid" is read uninitialized, comparing it against ~0. Initialize new_rid and compare it against UINT32_MAX instead of ~0. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
parent
621f561a9c
commit
d2a08f5d67
@ -911,7 +911,7 @@ static void log_user_primary_group_change(
|
|||||||
const int status)
|
const int status)
|
||||||
{
|
{
|
||||||
TALLOC_CTX *ctx = talloc_new(NULL);
|
TALLOC_CTX *ctx = talloc_new(NULL);
|
||||||
uint32_t new_rid;
|
uint32_t new_rid = UINT32_MAX;
|
||||||
struct dom_sid *account_sid = NULL;
|
struct dom_sid *account_sid = NULL;
|
||||||
int ret;
|
int ret;
|
||||||
const struct ldb_message *msg = dsdb_audit_get_message(acc->request);
|
const struct ldb_message *msg = dsdb_audit_get_message(acc->request);
|
||||||
@ -945,7 +945,7 @@ static void log_user_primary_group_change(
|
|||||||
* Otherwise only log if the primary group has actually changed.
|
* Otherwise only log if the primary group has actually changed.
|
||||||
*/
|
*/
|
||||||
if (account_sid != NULL &&
|
if (account_sid != NULL &&
|
||||||
new_rid != ~0 &&
|
new_rid != UINT32_MAX &&
|
||||||
acc->primary_group != new_rid) {
|
acc->primary_group != new_rid) {
|
||||||
const char* group = get_primary_group_dn(
|
const char* group = get_primary_group_dn(
|
||||||
ctx,
|
ctx,
|
||||||
|
Loading…
Reference in New Issue
Block a user