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

Re: [PATCH v10 0/4] cat-file: add support for "-allow-unknown-type"

From
karthik nayak <karthik.188@gmail.com>
Date
May 4, 2015, 13:31 UTC
Message-ID
<554774A4.4020504@gmail.com>
In-Reply-To
<CAPig+cStUNPZqEyE1rJVj5AsTeZFU54mc97rgQqiPbr5V1B0Sw@mail.gmail.com>
On 05/04/2015 09:00 AM, Eric Sunshine wrote:
Show 28 quoted lines
> On Sun, May 3, 2015 at 10:55 PM, Eric Sunshine <sunshine@sunshineco.com> wrote:
>> On Sun, May 3, 2015 at 8:14 PM, Junio C Hamano <gitster@pobox.com> wrote:
>>> Junio C Hamano <gitster@pobox.com> writes:
>>>
>>>> Hmmmm... you do not seem to pass your own test.
>>>>
>>>> expecting success:
>>>>          echo $bogus_type >expect &&
>>>>          git cat-file -t --allow-unknown-type $bogus_sha1 >actual &&
>>>>          test_cmp expect actual
>>>>
>>>> --- expect      2015-05-04 00:09:24.327335512 +0000
>>>> +++ actual      2015-05-04 00:09:24.335335473 +0000
>>>> @@ -1 +1 @@
>>>> -abcdefghijklmnopqrstuvwxyz1234679
>>>> +abcdefghijklmnopqrstuvwxyz123467abcdefghijklmnopqrstuvwxyz1234679
>>>> not ok 86 - Type of broken object is correct when type is large
>>>
>>> Perhaps it would have a better chance of being correct with this
>>> squashed in.
>>
>> Interestingly, neither test passes on Mac OS X even with this fixup.
>> In fact, the git-hash-object invocation which computes/retrieves
>> 'bogus_sha1' with the extra long bogus type crashes with SIGABRT in
>> write_sha1_file_prepare(). Still investigating.
>
> It's a buffer overflow problem. I'm preparing a patch.
>
Just saw your patch, thanks Eric.
Previous: Eric SunshineNext: karthik nayak
Message 16 of 22 in “cat-file: add support for "-allow-unknown-type"”
  1. 0/4 cat-file: add support for "-allow-unknown-type"karthik nayak, May 3, 2015
  2. 1/4 sha1_file: support reading from a loose object of unknown typeKarthik Nayak, May 3, 2015
  3. 2/4 cat-file: make the options mutually exclusiveKarthik Nayak, May 3, 2015
  4. 3/4 cat-file: teach cat-file a '--allow-unknown-type' optionKarthik Nayak, May 3, 2015
  5. Eric SunshineMay 5, 2015
  6. 4/4 t1006: add tests for git cat-file --allow-unknown-typeKarthik Nayak, May 3, 2015
  7. Eric SunshineMay 5, 2015
  8. karthik nayakMay 5, 2015
  9. Junio C HamanoMay 6, 2015
  10. Eric SunshineMay 4, 2015
  11. karthik nayakMay 5, 2015
  12. Junio C HamanoMay 4, 2015
  13. Junio C HamanoMay 4, 2015
  14. Eric SunshineMay 4, 2015
  15. Eric SunshineMay 4, 2015
  16. karthik nayakMay 4, 2015
  17. karthik nayakMay 6, 2015
  18. Junio C HamanoMay 6, 2015
  19. Karthik NayakMay 7, 2015
  20. Junio C HamanoMay 7, 2015
  21. karthik nayakMay 4, 2015
  22. Junio C HamanoMay 4, 2015

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.