Orivej Desh wrote on Sat, 25 Jul 2020 23:27 +0000:
> 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.

Orivej Desh wrote on Sat, 25 Jul 2020 23:27 +0000:
> [[[
> 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.

Well written.

> ]]]
> +++ subversion/libsvn_fs_fs/index.c   (working copy)
> @@ -827,7 +827,7 @@ svn_fs_fs__l2p_index_append(svn_checksum_t **check
>        /* handle new revision */
> -      if ((entry > 0 && proto_entry.offset == 0) || eof)
> +      if (eof || (entry > 0 && proto_entry.offset == 0))

Looks good to me, +1.

Does libsvn_fs_x need the same change?

Thanks for the patch,

Daniel

Reply via email to