1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00
samba-mirror/source4/dsdb
Andreas Schneider 3cb4073cd0 s4:dsdb: Avoid possible underflows with new_len
Found by Covscan.

"Error: INTEGER_OVERFLOW (CWE-190):
samba-4.20.0rc2/source4/dsdb/schema/schema_query.c:403: tainted_data_argument: The check ""i < new_len"" contains the tainted expression ""i"" which causes ""new_len"" to be considered tainted.
samba-4.20.0rc2/source4/dsdb/schema/schema_query.c:407: overflow: The expression ""new_len - i"" is deemed underflowed because at least one of its arguments has underflowed.
samba-4.20.0rc2/source4/dsdb/schema/schema_query.c:407: overflow: The expression ""(new_len - i) * 8UL"" is deemed underflowed because at least one of its arguments has underflowed.
samba-4.20.0rc2/source4/dsdb/schema/schema_query.c:407: overflow_sink: ""(new_len - i) * 8UL"", which might have underflowed, is passed to ""memmove(val1, val2, (new_len - i) * 8UL)"". [Note: The source code implementation of the function has been overridden by a builtin model.]
  405|   			const char **val2 = &attr_list[i];
  406|   			if (ldb_attr_cmp(*val1, *val2) == 0) {
  407|-> 				memmove(val1, val2, (new_len - i) * sizeof( *attr_list));
  408|   				attr_list[new_len-1] = NULL;
  409|   				new_len--;"

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
2024-06-24 06:14:36 +00:00
..
common dsdb: Prepare to handle smartcard password rollover 2024-06-10 04:27:30 +00:00
dns s4: rename source4/smbd/ to source4/samba/ 2020-11-27 10:07:18 +00:00
gmsa kdc: Use a consistent, stable time throughout the Heimdal KDC 2024-06-10 04:27:30 +00:00
kcc s4:dsdb: Fix code spelling 2023-09-11 02:42:41 +00:00
repl s4:dsdb/repl: let drepl_out_helpers.c always go via dreplsrv_out_drsuapi_send() 2024-05-22 04:23:29 +00:00
samdb s4:dsdb: Remove trailing whitespace 2024-06-11 04:32:30 +00:00
schema s4:dsdb: Avoid possible underflows with new_len 2024-06-24 06:14:36 +00:00
tests/python python: Move get_admin_sid() to SamDB 2024-04-24 05:16:29 +00:00
pydsdb.c pyldb: Include a reference to the Ldb in objects that use 2024-04-10 05:13:32 +00:00
samdb.pc.in
wscript_build s4:dsdb: Add functions for Group Managed Service Accounts implementation 2024-04-16 03:58:31 +00:00