You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ja...@apache.org on 2017/11/26 06:46:13 UTC
svn commit: r1816366 -
/subversion/trunk/subversion/tests/libsvn_subr/subst_translate-test.c
Author: jamessan
Date: Sun Nov 26 06:46:13 2017
New Revision: 1816366
URL: http://svn.apache.org/viewvc?rev=1816366&view=rev
Log:
* subversion/tests/libsvn_subr/subst_translate-test.c
(test_svn_subst_translate_string2_null_encoding): Adjust size for strncpy()
to ensure buffer is NULL-terminated.
Found by: Coverity <https://scan.coverity.com>
(CID: 1356919)
Modified:
subversion/trunk/subversion/tests/libsvn_subr/subst_translate-test.c
Modified: subversion/trunk/subversion/tests/libsvn_subr/subst_translate-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_subr/subst_translate-test.c?rev=1816366&r1=1816365&r2=1816366&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_subr/subst_translate-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_subr/subst_translate-test.c Sun Nov 26 06:46:13 2017
@@ -158,7 +158,7 @@ test_svn_subst_translate_string2_null_en
};
const char **other_locale;
- strncpy(orig_lc_all, setlocale(LC_ALL, NULL), sizeof (orig_lc_all));
+ strncpy(orig_lc_all, setlocale(LC_ALL, NULL), sizeof (orig_lc_all) - 1);
for (other_locale = other_locales; *other_locale != NULL; ++other_locale)
{