subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhuij...@apache.org
Subject svn commit: r1655723 - in /subversion/trunk/subversion: bindings/javahl/native/CommitMessage.cpp libsvn_client/copy.c
Date Thu, 29 Jan 2015 16:12:17 GMT
Author: rhuijben
Date: Thu Jan 29 16:12:16 2015
New Revision: 1655723

URL: http://svn.apache.org/r1655723
Log:
Fix an exception in JavaHL caused by an invalid enum value at different layers.

* subversion/bindings/javahl/native/CommitMessage.cpp
  (CommitMessage::getCommitMessage):
      If constructing the item failed we should return.

* subversion/libsvn_client/copy.c
  (try_copy): Property initialize src_kind field.

Modified:
    subversion/trunk/subversion/bindings/javahl/native/CommitMessage.cpp
    subversion/trunk/subversion/libsvn_client/copy.c

Modified: subversion/trunk/subversion/bindings/javahl/native/CommitMessage.cpp
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/native/CommitMessage.cpp?rev=1655723&r1=1655722&r2=1655723&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/native/CommitMessage.cpp (original)
+++ subversion/trunk/subversion/bindings/javahl/native/CommitMessage.cpp Thu Jan 29 16:12:16
2015
@@ -94,6 +94,9 @@ CommitMessage::getCommitMessage(const ch
 
       jobject jitem = CreateJ::CommitItem(item);
 
+      if (!jitem)
+        return SVN_NO_ERROR; /* Exception thrown */
+
       // store the Java object into the array
       jitems.push_back(jitem);
     }

Modified: subversion/trunk/subversion/libsvn_client/copy.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/copy.c?rev=1655723&r1=1655722&r2=1655723&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/copy.c (original)
+++ subversion/trunk/subversion/libsvn_client/copy.c Thu Jan 29 16:12:16 2015
@@ -2008,7 +2008,7 @@ try_copy(svn_boolean_t *timestamp_sleep,
         {
           svn_client_copy_source_t *source = APR_ARRAY_IDX(sources, i,
                                                svn_client_copy_source_t *);
-          svn_client__copy_pair_t *pair = apr_palloc(pool, sizeof(*pair));
+          svn_client__copy_pair_t *pair = apr_pcalloc(pool, sizeof(*pair));
           const char *src_basename;
           svn_boolean_t src_is_url = svn_path_is_url(source->path);
 
@@ -2030,6 +2030,7 @@ try_copy(svn_boolean_t *timestamp_sleep,
 
           pair->src_op_revision = *source->revision;
           pair->src_peg_revision = *source->peg_revision;
+          pair->src_kind = svn_node_unknown;
 
           SVN_ERR(svn_opt_resolve_revisions(&pair->src_peg_revision,
                                             &pair->src_op_revision,
@@ -2058,7 +2059,7 @@ try_copy(svn_boolean_t *timestamp_sleep,
   else
     {
       /* Only one source path. */
-      svn_client__copy_pair_t *pair = apr_palloc(pool, sizeof(*pair));
+      svn_client__copy_pair_t *pair = apr_pcalloc(pool, sizeof(*pair));
       svn_client_copy_source_t *source =
         APR_ARRAY_IDX(sources, 0, svn_client_copy_source_t *);
       svn_boolean_t src_is_url = svn_path_is_url(source->path);
@@ -2070,6 +2071,7 @@ try_copy(svn_boolean_t *timestamp_sleep,
                                         source->path, pool));
       pair->src_op_revision = *source->revision;
       pair->src_peg_revision = *source->peg_revision;
+      pair->src_kind = svn_node_unknown;
 
       SVN_ERR(svn_opt_resolve_revisions(&pair->src_peg_revision,
                                         &pair->src_op_revision,



Mime
View raw message