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

RE: svn commit: r33975 - in trunk/subversion: libsvn_fs libsvn_fs_base libsvn_fs_base/bdb libsvn_fs_base/notes libsvn_fs_base/util libsvn_fs_fs tests/libsvn_fs_base

From: Daniel Shahaf <d.s_at_daniel.shahaf.name>
Date: Fri, 26 Dec 2008 14:19:06 +0200 (Jerusalem Standard Time)

Bert Huijben wrote on Sun, 16 Nov 2008 at 13:47 +0100:
> > svn_checksum_to_cstring_display(checked_checksum,
> > trail->pool));
> > }
>
> This last line gives
> f:\svn-2008\dev\subversion\libsvn_fs_base\reps-strings.c(926) : warning C4700: uninitialized local variable 'checked_checksum' used
>
> (See also the buildbot output)
>
> This patch removes all possible initializations of checked_checksum, but
> starts using it in this error message.
>

Still present in current trunk; the code reads:

          if (args->rb->offset == args->rb->size)
            {
              representation_t *rep;
              svn_checksum_t *checked_checksum;

              svn_checksum_final(&args->rb->md5_checksum,
                                 args->rb->md5_checksum_ctx, trail->pool);
              svn_checksum_final(&args->rb->sha1_checksum,
                                 args->rb->sha1_checksum_ctx, trail->pool);
              args->rb->checksum_finalized = TRUE;

              SVN_ERR(svn_fs_bdb__read_rep(&rep, args->rb->fs,
                                           args->rb->rep_key,
                                           trail, trail->pool));

              if (rep->md5_checksum
                  && (! svn_checksum_match(rep->md5_checksum,
                                           args->rb->md5_checksum)))
                return svn_error_createf
                  (SVN_ERR_FS_CORRUPT, NULL,
                   _("MD5 checksum mismatch on rep '%s':\n"
                     " expected: %s\n"
                     " actual: %s\n"), args->rb->rep_key,
                   svn_checksum_to_cstring_display(rep->md5_checksum,
                                                   trail->pool),
                   svn_checksum_to_cstring_display(checked_checksum,

which might segfault (because checked_checksum is not initialized) if the
MD5 ever mismatches.

Daniel

> Bert

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=992899
Received on 2008-12-26 14:18:17 CET

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