svn commit: r1925946 - /subversion/branches/utf8-cmdline-prototype/subversion/libsvn_subr/opt.c

[email protected]
Newsgroups gmane.comp.version-control.subversion.svn
Message-ID <[email protected]>
Author: rinrab
Date: Thu May 29 17:14:06 2025
New Revision: 1925946

URL: http://svn.apache.org/viewvc?rev=1925946&view=rev
Log:
On the 'utf8-cmdline-prototype' branch: Follow-up to r1925942 and r1925944:
Fix crash with NULL known_targets.

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

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=1925946&r1=1925945&r2=1925946&view=diff
==============================================================================
--- subversion/branches/utf8-cmdline-prototype/subversion/libsvn_subr/opt.c (original)
+++ subversion/branches/utf8-cmdline-prototype/subversion/libsvn_subr/opt.c Thu May 29 17:14:06 2025
@@ -255,8 +255,10 @@ svn_opt__collect_targets(apr_array_heade
                          apr_pool_t *pool)
 {
   int i;
-  apr_array_header_t *input_targets = apr_array_make(
-      pool, utf8_targets->nelts + known_targets->nelts, sizeof(const char *));
+  int target_count = utf8_targets->nelts + (known_targets
+                                            ? known_targets->nelts : 0);
+  apr_array_header_t *input_targets = apr_array_make(pool, target_count,
+                                                     sizeof(const char *));
 
   for (i = 0; i < utf8_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.