[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] issue #2979: SVNAdmin::load passes a null data buffer

From: Mark Phippard <markphip_at_gmail.com>
Date: Wed, 5 Aug 2009 16:11:32 -0400

On Tue, Aug 4, 2009 at 2:08 PM, Dave Brown<dave.brown_at_wandisco.com> wrote:
> [[[
> Fix issue #2979: javahl's SVNAdmin::load() sometimes passes a null data
> buffer
> to the read() method of the caller's InputInterface.  JNIUtil::makeByteArray
> was returning NULL when the requested byte[] length was 0.  This in turn was
> provoked by a read(length=0) on the svn_stream_t loading a repository dump.
> read(0) is perfectly valid (albeit superfluous), such as when parsing a
> property value with length zero.
>
> The fix just returns a byte[] with length 0 as requested from JNIUtil.cpp.
>
> *
> subversion/bindings/javahl/tests/org/tigris/subversion/javahl/SVNAdminTests.java
>  (testLoadRepo): Added test for issue 2979
>  (testSetRevProp): Improved test, made it actually verify things
>
> *
> subversion/bindings/javahl/tests/org/tigris/subversion/javahl/SVNTests.java
>  (OneTest): Tweaked inner class optionally not to load sample files into
>  the test repository.  Keep behavior expected by existing tests.
>
> * subversion/bindings/javahl/tests/data/issue2979.dump
>  Data for reproducible test case of issue #2979.  1400 bytes on disk.  If
>  there's an objection to checking in test data as a separate file, I could
>  boil down a smaller bit of repro data in a String literal in the test
> file.
>  I really just need a zero-length prop value in a dump file.
>
> * subversion/bindings/javahl/native/JNIUtil.cpp
>  (makeJByteArray) Do not treat byte[0] and NULL as equivalent.
> ]]]

There was an unrelated test improvement included in this patch
(testSetRevProp). I committed it separately in r38753 with just some
formatting corrections.

The rest was committed in r38754 with formatting corrections.

-- 
Thanks
Mark Phippard
http://markphip.blogspot.com/
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2380618
Received on 2009-08-05 22:11:48 CEST

This is an archived mail posted to the Subversion Dev mailing list.