Return-Path: Delivered-To: apmail-directory-commits-archive@www.apache.org Received: (qmail 81560 invoked from network); 4 Jun 2010 13:58:45 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 4 Jun 2010 13:58:45 -0000 Received: (qmail 29365 invoked by uid 500); 4 Jun 2010 13:58:44 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 29270 invoked by uid 500); 4 Jun 2010 13:58:44 -0000 Mailing-List: contact commits-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@directory.apache.org Delivered-To: mailing list commits@directory.apache.org Received: (qmail 29254 invoked by uid 99); 4 Jun 2010 13:58:44 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Jun 2010 13:58:44 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Jun 2010 13:58:42 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id D4E2123889B6; Fri, 4 Jun 2010 13:58:20 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@directory.apache.org From: felixk@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100604135820.D4E2123889B6@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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 {