Skip to content

Commit 469a338

Browse files
Fixed null blob exception when loading prefixtable
1 parent 0d44693 commit 469a338

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

Documentation/CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ All notable changes to this project will be documented in this file. The format
99

1010
### Fixed
1111

12+
- Fixed a bug in prefix table parsing from `ntds.dit` files.
1213
- Re-enabled native ARM64 support in the PowerShell module.
1314

1415
## [6.0.1] - 2025-08-14
@@ -641,7 +642,8 @@ This is a [Chocolatey](https://chocolatey.org/packages/dsinternals-psmodule)-onl
641642
## 1.0 - 2015-01-20
642643
Initial release!
643644

644-
[Unreleased]: https://github.com/MichaelGrafnetter/DSInternals/compare/v6.0.1...HEAD
645+
[Unreleased]: https://github.com/MichaelGrafnetter/DSInternals/compare/v6.0.2...HEAD
646+
[6.0.2]: https://github.com/MichaelGrafnetter/DSInternals/compare/v6.0.1...v6.0.2
645647
[6.0.1]: https://github.com/MichaelGrafnetter/DSInternals/compare/v6.0...v6.0.1
646648
[6.0]: https://github.com/MichaelGrafnetter/DSInternals/compare/v5.4.1...v6.0
647649
[5.4.1]: https://github.com/MichaelGrafnetter/DSInternals/compare/v5.3...v5.4.1

Src/DSInternals.DataStore/DirectorySchema.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,13 @@ public static DirectorySchema Create(IsamDatabase database)
206206

207207
// Load the prefix table from the Schema NC
208208
byte[] binaryPrefixMap = cursor.RetrieveColumnAsByteArray(prefixMapColumn);
209-
schema.PrefixTable.LoadFromBlob(binaryPrefixMap);
210209

210+
if (binaryPrefixMap != null || binaryPrefixMap.Length > 0)
211+
{
212+
// Clean older ADs might not contain any prefix table
213+
schema.PrefixTable.LoadFromBlob(binaryPrefixMap);
214+
}
215+
211216
// Load the list of attributes and classes.
212217
// Corresponding LDAP filter: (lDAPDisplayName=*)
213218
cursor.CurrentIndex = baseSchema.FindAttribute(AttributeType.LdapDisplayName).DerivedIndexName;

0 commit comments

Comments
 (0)