Skip to content

Commit

Permalink
Fix for DIRSERVER-2409
Browse files Browse the repository at this point in the history
  • Loading branch information
elecharny committed Aug 14, 2024
1 parent 0d2540f commit cc42231
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import jdbm.helper.Serializer;

import org.apache.directory.api.util.Strings;
import org.apache.directory.server.i18n.I18n;


/**
Expand Down Expand Up @@ -57,6 +58,12 @@ public Object deserialize( byte[] bytes ) throws IOException
{
return "";
}

// Check that we don't have a odd number of bytes (we should have an even number of bytes)
if ( ( bytes.length & 1 ) == 1 )
{
throw new IOException( I18n.err( I18n.ERR_31001_ODD_NUMBER_OF_BYTES_IN_SERIALIZED_STRING ) );
}

char[] strchars = new char[bytes.length >> 1];
int pos = 0;
Expand Down

0 comments on commit cc42231

Please sign in to comment.