[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] Fix harmless uninitialized read in svn_fs_fs__l2p_index_append

From: Daniel Shahaf <d.s_at_daniel.shahaf.name>
Date: Mon, 27 Jul 2020 01:40:38 +0000

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
Received on 2020-07-27 03:40:56 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.