Clang 10 memory sanitizer reports an uninitialized read of .offset in
     if ((entry > 0 && proto_entry.offset == 0) || eof)
when read_l2p_entry_from_proto_index set eof and left the proto_entry unset.
[[[
Fix harmless uninitialized read in svn_fs_fs__l2p_index_append

* subversion/libsvn_fs_fs/index.c
  (svn_fs_fs__l2p_index_append): Do not access proto_entry.offset when
  it is unset due to reaching eof.
]]]
Index: subversion/libsvn_fs_fs/index.c
===================================================================
--- subversion/libsvn_fs_fs/index.c	(revision 1880306)
+++ subversion/libsvn_fs_fs/index.c	(working copy)
@@ -827,7 +827,7 @@ svn_fs_fs__l2p_index_append(svn_checksum_t **check
                                               &eof, local_pool));

       /* handle new revision */
-      if ((entry > 0 && proto_entry.offset == 0) || eof)
+      if (eof || (entry > 0 && proto_entry.offset == 0))
         {
           /* dump entries, grouped into pages */

Reply via email to