Skip to content

Commit

Permalink
Fix for DIRSERVER-2408
Browse files Browse the repository at this point in the history
  • Loading branch information
elecharny committed Aug 14, 2024
1 parent cc42231 commit f7ea39f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ public enum I18n
// apacheds-jdbm-partition errors 31000 - 31999
ERR_31000_COULD_NOT_CREATE_DIRECTORY("ERR_31000_COULD_NOT_CREATE_DIRECTORY"),
ERR_31001_ODD_NUMBER_OF_BYTES_IN_SERIALIZED_STRING("ERR_31001_ODD_NUMBER_OF_BYTES_IN_SERIALIZED_STRING"),
ERR_31002_NEGATIOVE_NB_ATTRIBUTES_IN_ENTRY("ERR_31002_NEGATIOVE_NB_ATTRIBUTES_IN_ENTRY"),

// apacheds-kerberos-codec errors 32000 - 32999
// apacheds-ldif-partition errors 33000 - 33999
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ ERR_11000_COULD_NOT_CREATE_DIRECTORY=Could not create directory {0}
# apacheds-jdbm-partition errors 31000 - 31999
ERR_31000_COULD_NOT_CREATE_DIRECTORY=Could not create directory {0}
ERR_31001_ODD_NUMBER_OF_BYTES_IN_SERIALIZED_STRING=The serialized String contains an odd number of bytes
ERR_31002_NEGATIOVE_NB_ATTRIBUTES_IN_ENTRY=The number of attributes is negative

# apacheds-kerberos-codec errors 32000 - 32999
# apacheds-ldif-partition errors 33000 - 33999
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,11 @@ public Object deserialize( byte[] bytes ) throws IOException

// Read the number of attributes
int nbAttributes = in.readInt();

if ( nbAttributes < 0 )
{
throw new IOException( I18n.err( I18n.ERR_31002_NEGATIOVE_NB_ATTRIBUTES_IN_ENTRY ) );
}

// Read the attributes
for ( int i = 0; i < nbAttributes; i++ )
Expand Down

0 comments on commit f7ea39f

Please sign in to comment.