"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
"Todd C. Miller" <millert@openbsd.org>
Subject:
Re: plug memory leak in got_pack_dump_delt_chain_to_file()
To:
Omar Polo <op@omarpolo.com>
Cc:
gameoftrees@openbsd.org
Date:
Tue, 13 Feb 2024 13:00:58 -0700

Download raw body.

Thread
On Tue, 13 Feb 2024 20:57:52 +0100, Omar Polo wrote:

> On 2024/02/13 12:51:44 -0700, Todd C. Miller <millert@openbsd.org> wrote:
> > Won't this cause the uninitialized contents of accum_buf to be
> > written out?  I think this can happen for other error paths as well.
>
> ah yeah, I forgot to ask about this.  accum_size is still zero so we
> don't end up reading the uninitialized memory.  However, we may clobber
> err on fwrite, and we could handle it slightly better.
>
> what about this?

I like it.  Never writing accum_buf on err seems like the safest
approach.

 - todd