directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fel...@apache.org
Subject svn commit: r951413 - in /directory/shared/trunk: i18n/src/main/java/org/apache/directory/shared/i18n/ i18n/src/main/resources/org/apache/directory/shared/i18n/ ldap/src/main/java/org/apache/directory/shared/ldap/entry/
Date Fri, 04 Jun 2010 13:58:20 GMT
Author: felixk
Date: Fri Jun  4 13:58:20 2010
New Revision: 951413

URL: http://svn.apache.org/viewvc?rev=951413&view=rev
Log:
Respect returned values

Modified:
    directory/shared/trunk/i18n/src/main/java/org/apache/directory/shared/i18n/I18n.java
    directory/shared/trunk/i18n/src/main/resources/org/apache/directory/shared/i18n/errors.properties
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/BinaryValue.java

Modified: directory/shared/trunk/i18n/src/main/java/org/apache/directory/shared/i18n/I18n.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/i18n/src/main/java/org/apache/directory/shared/i18n/I18n.java?rev=951413&r1=951412&r2=951413&view=diff
==============================================================================
--- directory/shared/trunk/i18n/src/main/java/org/apache/directory/shared/i18n/I18n.java (original)
+++ directory/shared/trunk/i18n/src/main/java/org/apache/directory/shared/i18n/I18n.java Fri
Jun  4 13:58:20 2010
@@ -618,6 +618,7 @@ public enum I18n
     ERR_04477_NO_VALID_AT_FOR_THIS_ID( "ERR_04477_NO_VALID_AT_FOR_THIS_ID" ),
     ERR_04478_NO_VALUE_NOT_ALLOWED( "ERR_04478_NO_VALUE_NOT_ALLOWED" ),
     ERR_04479_INVALID_SYNTAX_VALUE( "ERR_04479_INVALID_SYNTAX_VALUE" ),
+    ERR_04480_END_OF_STREAM( "ERR_04480_END_OF_STREAM" ),
 
     // ldap-constants
     ERR_05001( "ERR_05001" ),

Modified: directory/shared/trunk/i18n/src/main/resources/org/apache/directory/shared/i18n/errors.properties
URL: http://svn.apache.org/viewvc/directory/shared/trunk/i18n/src/main/resources/org/apache/directory/shared/i18n/errors.properties?rev=951413&r1=951412&r2=951413&view=diff
==============================================================================
--- directory/shared/trunk/i18n/src/main/resources/org/apache/directory/shared/i18n/errors.properties
(original)
+++ directory/shared/trunk/i18n/src/main/resources/org/apache/directory/shared/i18n/errors.properties
Fri Jun  4 13:58:20 2010
@@ -602,6 +602,7 @@ ERR_04476=Cannot set an AttributeType {0
 ERR_04477_NO_VALID_AT_FOR_THIS_ID=Cannot find a valid AttributeType for the ''{0}'' id
 ERR_04478_NO_VALUE_NOT_ALLOWED=Cannot create or add an Attribute with no value in it
 ERR_04479_INVALID_SYNTAX_VALUE= The value ''{0}'' does not respect the AttributeType ''{1}''
syntax
+ERR_04480_END_OF_STREAM=End of stream
 
 # ldap-constants
 ERR_05001=Unknown AuthenticationLevel {0}

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/BinaryValue.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/BinaryValue.java?rev=951413&r1=951412&r2=951413&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/BinaryValue.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/BinaryValue.java
Fri Jun  4 13:58:20 2010
@@ -566,7 +566,10 @@ public class BinaryValue extends Abstrac
 
             if ( wrappedLength > 0 )
             {
-                in.read( wrappedValue );
+                if ( in.read( wrappedValue ) == -1 )
+                {
+                    throw new IOException( I18n.err( I18n.ERR_04480_END_OF_STREAM ) );
+                }
             }
         }
 
@@ -775,7 +778,10 @@ public class BinaryValue extends Abstrac
                         normalizedValue = new byte[normalizedLength];
 
                         // Read the normalized value
-                        in.read( normalizedValue, 0, normalizedLength );
+                        if ( in.read( normalizedValue, 0, normalizedLength ) == -1 )
+                        {
+                            throw new IOException( I18n.err( I18n.ERR_04480_END_OF_STREAM
) );
+                        }
                     }
                     else
                     {



Mime
View raw message