]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
CVE-2022-32745 s4/dsdb/util: Correctly copy values into message element
authorJoseph Sutton <josephsutton@catalyst.net.nz>
Fri, 3 Jun 2022 04:16:31 +0000 (16:16 +1200)
committerJule Anger <janger@samba.org>
Sun, 24 Jul 2022 09:41:53 +0000 (11:41 +0200)
To use memcpy(), we need to specify the number of bytes to copy, rather
than the number of ldb_val structures.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15008

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
source4/dsdb/samdb/ldb_modules/util.c

index 35ae110b5efc7fec89eecfb8fb6328a9c36953b0..e7fe8f855df1376d1697740cb2c27b5e426369a5 100644 (file)
@@ -1559,7 +1559,7 @@ int dsdb_get_expected_new_values(TALLOC_CTX *mem_ctx,
                        }
                        memcpy(v,
                               tmp_el->values,
-                              tmp_el->num_values);
+                              tmp_el->num_values * sizeof(*v));
                        v += tmp_el->num_values;
                }
        }