git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2 1/1] midx.c: fix an integer overflow

From
DRDamien Robert <damien.olivier.robert@gmail.com>
Date
Mar 12, 2020, 21:41 UTC
Message-ID
<20200312214123.sqja3fvuiaaspxwp@doriath>
In-Reply-To
<a538c497-a79d-43be-3d00-c7a619acc4e6@gmail.com>
From Derrick Stolee, Thu 12 Mar 2020 at 14:28:11 (-0400) :
> I _think_ the t/tXXXX directories are used for this kind of data storage,
> so you could generate an empty multi-pack-index from an older version of
> Git then store it there.

Yes I anticipated that and have one available on hand :) It weights 1116 characters.

Show 9 quoted lines
> > -	if (flags & MIDX_PROGRESS)
> > -		progress = start_sparse_progress(_("Verifying OID order in multi-pack-index"),
> > -						 m->num_objects - 1);
> > -	for (i = 0; i < m->num_objects - 1; i++) {
> > -		struct object_id oid1, oid2;
> > +	if (m->num_objects == 0)
> > +		midx_report(_("Warning: the midx contains no oid."));
> 
> Should this "Warning: " be here? The other calls to midx_report() do not have such prefix.
Right, I agree it should not.
> Also, it may be valuable to return from this block so you do not need to put the block below in a tabbed block, reducing the complexity of this patch.
Agreed: we don't want to run the other checks anyway if we don't have any
objects.
That'll be for v3 once I get advice on what to do for tests.
Previous: Derrick StoleeNext: Damien Robert
Message 9 of 17 in “midx.c: fix an integer overflow”
  1. 1/1 midx.c: fix an integer overflowDamien Robert, Feb 28, 2020
  2. Jeff KingFeb 28, 2020
  3. Junio C HamanoFeb 28, 2020
  4. Damien RobertFeb 29, 2020
  5. Damien RobertFeb 29, 2020
  6. 1/1 midx.c: fix an integer overflowDamien Robert, Mar 12, 2020
  7. Damien RobertMar 12, 2020
  8. Derrick StoleeMar 12, 2020
  9. Damien RobertMar 12, 2020
  10. 1/1 midx.c: fix an integer overflowDamien Robert, Mar 23, 2020
  11. Jeff KingMar 24, 2020
  12. Junio C HamanoMar 24, 2020
  13. 1/1 midx.c: fix an integer overflowDamien Robert, Mar 26, 2020
  14. Junio C HamanoMar 26, 2020
  15. Damien RobertMar 28, 2020
  16. Junio C HamanoMar 28, 2020
  17. 1/1 midx.c: fix an integer underflowDamien Robert, Mar 28, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.