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

svn commit: r1549766 - in /subversion/trunk/subversion: libsvn_fs_fs/cached_data.c libsvn_fs_x/cached_data.c

Author: brane
Date: Tue Dec 10 06:39:45 2013
New Revision: 1549766

URL: http://svn.apache.org/r1549766
Log:
Avoid undefined behavior (and crashing) within FSFS and FSX when
there is no changes cache.

* subversion/libsvn_fs_fs/cached_data.c
  (svn_fs_fs__get_changes): Avoid possible uninitialized variable access by
    setting FOUND to FALSE in case we do not have a CHANGES_CACHE.
* subversion/libsvn_fs_x/cached_data.c
  (svn_fs_x__get_changes): Avoid possible uninitialized variable access by
    setting FOUND to FALSE in case we do not have CHANGES_CACHE and
    CHANGES_CONTAINER_CACHE.

Patch by: Evgeny Kotkov

Modified:
    subversion/trunk/subversion/libsvn_fs_fs/cached_data.c
    subversion/trunk/subversion/libsvn_fs_x/cached_data.c

Modified: subversion/trunk/subversion/libsvn_fs_fs/cached_data.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/cached_data.c?rev=1549766&r1=1549765&r2=1549766&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/cached_data.c (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/cached_data.c Tue Dec 10 06:39:45 2013
@@ -2177,8 +2177,14 @@ svn_fs_fs__get_changes(apr_array_header_
   /* try cache lookup first */
 
   if (ffd->changes_cache)
-    SVN_ERR(svn_cache__get((void **) changes, &found, ffd->changes_cache,
-                           &rev, pool));
+    {
+      SVN_ERR(svn_cache__get((void **) changes, &found, ffd->changes_cache,
+                             &rev, pool));
+    }
+  else
+    {
+      found = FALSE;
+    }
 
   if (!found)
     {

Modified: subversion/trunk/subversion/libsvn_fs_x/cached_data.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_x/cached_data.c?rev=1549766&r1=1549765&r2=1549766&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_x/cached_data.c (original)
+++ subversion/trunk/subversion/libsvn_fs_x/cached_data.c Tue Dec 10 06:39:45 2013
@@ -2335,6 +2335,10 @@ svn_fs_x__get_changes(apr_array_header_t
       SVN_ERR(svn_cache__get((void **) changes, &found, ffd->changes_cache,
                              &rev, pool));
     }
+  else
+    {
+      found = FALSE;
+    }
 
   if (!found)
     {