Author: ivan
Date: Sat Oct 31 23:02:27 2026
New Revision: 1939854

Log:
Follow-up r1939853: do not access uninitialized variable.

* subversion/libsvn_subr/utf.c
  (convert_to_stringbuf): Initialize DESTLEN after BUFLEN is initialized.

Modified:
   subversion/trunk/subversion/libsvn_subr/utf.c

Modified: subversion/trunk/subversion/libsvn_subr/utf.c
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/utf.c       Sat Oct 31 22:59:03 
2026        (r1939853)
+++ subversion/trunk/subversion/libsvn_subr/utf.c       Sat Oct 31 23:02:27 
2026        (r1939854)
@@ -512,7 +512,7 @@ convert_to_stringbuf(xlate_handle_node_t
   apr_size_t buflen;
   apr_status_t apr_err;
   apr_size_t srclen = src_length;
-  apr_size_t destlen = buflen;
+  apr_size_t destlen;
 
   /* Not only does it not make sense to convert an empty string, but
      apr-iconv is quite unreasonable about not allowing that. */
@@ -528,6 +528,7 @@ convert_to_stringbuf(xlate_handle_node_t
      to be enough, we'll grow the buffer again, sizing it based on a
      1:3 ratio of the remainder of the string. */
   buflen = src_length * 2;
+  destlen = buflen;
   *dest = svn_stringbuf_create_ensure(buflen + 1, pool);
 
   do

Reply via email to