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

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

From: Dave Brown <dave.brown_at_wandisco.com>
Date: Tue, 04 Aug 2009 11:08:06 -0700

[[[
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.
]]]

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2380112

Received on 2009-08-05 02:21:32 CEST

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.