You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by rh...@apache.org on 2013/10/21 12:30:01 UTC

svn commit: r1534082 - /subversion/trunk/subversion/libsvn_subr/win32_xlate.c

Author: rhuijben
Date: Mon Oct 21 10:30:01 2013
New Revision: 1534082

URL: http://svn.apache.org/r1534082
Log:
Following up on r1533994 and r1534037 resolve two off by one errors that were
originally hidden by making Windows handle the final '\0' byte. When r1534037
started passing the explicit length this handling was disabled.

* subversion/libsvn_subr/win32_xlate.c
  (svn_subr__win32_utf8_to_utf16,
   svn_subr__win32_utf16_to_utf8): Put '\0' in the buffer instead of one byte
     after the buffer.

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

Modified: subversion/trunk/subversion/libsvn_subr/win32_xlate.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/win32_xlate.c?rev=1534082&r1=1534081&r2=1534082&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/win32_xlate.c (original)
+++ subversion/trunk/subversion/libsvn_subr/win32_xlate.c Mon Oct 21 10:30:01 2013
@@ -263,7 +263,7 @@ svn_subr__win32_utf8_to_utf16(const WCHA
     return svn_error_wrap_apr(apr_get_os_error(),
                               _("Conversion to UTF-16 failed"));
 
-  wide_str[wide_count] = 0;
+  wide_str[wide_count-1] = 0;
   *result = wide_str;
 
   return SVN_NO_ERROR;
@@ -295,7 +295,7 @@ svn_subr__win32_utf16_to_utf8(const char
     return svn_error_wrap_apr(apr_get_os_error(),
                               _("Conversion from UTF-16 failed"));
 
-  utf8_str[utf8_count] = 0;
+  utf8_str[utf8_count-1] = 0;
   *result = utf8_str;
 
   return SVN_NO_ERROR;