svn commit: r1926018 - in /subversion/branches/utf8-cmdline-prototype/subversion: libsvn_client/cmdline.c libsvn_subr/opt.c

[email protected]
Newsgroups gmane.comp.version-control.subversion.svn
Message-ID <[email protected]>
Author: rinrab
Date: Sat May 31 19:57:33 2025
New Revision: 1926018

URL: http://svn.apache.org/viewvc?rev=1926018&view=rev
Log:
On the 'utf8-cmdline-prototype' branch: Fix EXCEPTION_ACCESS_VIOLATION
crash due to uninitialized apr array.

* subversion/libsvn_client/cmdline.c
  (svn_client__process_target_array): Initialize arrays with NULL so we let
   svn_opt* create them on their own.
* subversion/libsvn_subr/opt.c
  (svn_opt__target_array_parse,
   svn_opt__target_array_to_string): Invert condition that checks out
   parameters for NULL.

Modified:
    subversion/branches/utf8-cmdline-prototype/subversion/libsvn_client/cmdline.c
    subversion/branches/utf8-cmdline-prototype/subversion/libsvn_subr/opt.c

Modified: subversion/branches/utf8-cmdline-prototype/subversion/libsvn_client/cmdline.c
URL: http://svn.apache.org/viewvc/subversion/branches/utf8-cmdline-prototype/subversion/libsvn_client/cmdline.c?rev=1926018&r1=1926017&r2=1926018&view=diff
==============================================================================
--- subversion/branches/utf8-cmdline-prototype/subversion/libsvn_client/cmdline.c (original)
+++ subversion/branches/utf8-cmdline-prototype/subversion/libsvn_client/cmdline.c Sat May 31 19:57:33 2025
@@ -161,8 +161,8 @@ svn_client__process_target_array(apr_arr
   int i;
   svn_boolean_t rel_url_found = FALSE;
   const char *root_url = NULL;
-  apr_array_header_t *input_targets;
-  apr_array_header_t *parsed_targets;
+  apr_array_header_t *input_targets = NULL;
+  apr_array_header_t *parsed_targets = NULL;
   apr_array_header_t *reserved_names = NULL;
 
   /* Step 1:  create a master array of targets that are in UTF-8

Modified: subversion/branches/utf8-cmdline-prototype/subversion/libsvn_subr/opt.c
URL: http://svn.apache.org/viewvc/subversion/branches/utf8-cmdline-prototype/subversion/libsvn_subr/opt.c?rev=1926018&r1=1926017&r2=1926018&view=diff
==============================================================================
--- subversion/branches/utf8-cmdline-prototype/subversion/libsvn_subr/opt.c (original)
+++ subversion/branches/utf8-cmdline-prototype/subversion/libsvn_subr/opt.c Sat May 31 19:57:33 2025
@@ -628,7 +628,7 @@ svn_opt__target_array_parse(apr_array_he
 {
   int i;
 
-  if (*targets_p != NULL)
+  if (*targets_p == NULL)
     *targets_p = apr_array_make(pool, DEFAULT_ARRAY_SIZE,
                                 sizeof(svn_opt__target_t *));
 
@@ -651,7 +651,7 @@ svn_opt__target_array_to_string(apr_arra
 {
   int i;
 
-  if (*paths_p != NULL)
+  if (*paths_p == NULL)
     *paths_p = apr_array_make(pool, DEFAULT_ARRAY_SIZE, sizeof(const char *));
 
   for (i = 0; i < targets->nelts; i++)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.