Skip to content
This repository has been archived by the owner on Sep 11, 2020. It is now read-only.

plumbing: format: pktline, Accept oversized pkt-lines up to 65524 bytes #797

Merged
merged 1 commit into from
Apr 3, 2018
Merged

plumbing: format: pktline, Accept oversized pkt-lines up to 65524 bytes #797

merged 1 commit into from
Apr 3, 2018

Conversation

josephvusich
Copy link
Contributor

@josephvusich josephvusich commented Apr 3, 2018

The canonical Git client successfully decodes sideband packets up to
65524 bytes in length (4-byte header + 65520-byte payload). The Git
protocol documentation was updated in August 2016 to reduce the maximum
payload size to 65516 bytes, however old implementations still exist in
the wild emitting 65520-byte payloads.

As there is no technical difficulty with accepting (not emitting) larger
payload sizes, this change adjusts the limit check to allow successful
decoding of packets up to 65524 bytes. This change increases
compatibility with the current canonical Git implementation.

Doc change from August 2016:

Current packet buffer size is still LARGE_PACKET_MAX (+1 null):

LARGE_PACKET_MAX definition:

@josephvusich josephvusich changed the title Accept oversized pkt-lines up to 65524 bytes [WIP] Accept oversized pkt-lines up to 65524 bytes Apr 3, 2018
@josephvusich josephvusich changed the title [WIP] Accept oversized pkt-lines up to 65524 bytes Accept oversized pkt-lines up to 65524 bytes Apr 3, 2018
@josephvusich josephvusich changed the title Accept oversized pkt-lines up to 65524 bytes plumbing: format: pktline, Accept oversized pkt-lines up to 65524 bytes Apr 3, 2018
The canonical Git client successfully decodes sideband packets up to
65524 bytes in length (4-byte header + 65520-byte payload). The Git
protocol documentation was updated in August 2016 to reduce the maximum
payload size to 65516 bytes, however old implementations still exist in
the wild emitting 65520-byte payloads.

As there is no technical difficulty with accepting (not emitting) larger
payload sizes, this change adjusts the limit check to allow successful
decoding of packets up to 65524 bytes. This change increases
compatibility with the current canonical Git implementation.

Doc changes from August 2016:
  git/git@7841c48#diff-52695c8fe91b78b70cea44562ae28297L67

Current packet buffer size is still LARGE_PACKET_MAX (+1 null):
  https://github.com/git/git/blob/468165c1d8a442994a825f3684528361727cd8c0/sideband.c#L24
  https://github.com/git/git/blob/468165c1d8a442994a825f3684528361727cd8c0/sideband.c#L36

LARGE_PACKET_MAX definition:
  https://github.com/git/git/blob/468165c1d8a442994a825f3684528361727cd8c0/pkt-line.h#L100

Signed-off-by: Joseph Vusich <jvusich@amazon.com>
@mcuadros mcuadros merged commit 247cf69 into src-d:master Apr 3, 2018
@josephvusich josephvusich deleted the fix/oversize-pkt-line branch April 3, 2018 17:06
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants