mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-07 21:56:44 +00:00
pkt: bring back GIT_ESHORTBUFFER
The recent 64-bit Windows fixes changed the return code in git_pkt_parse_line() so it wouldn't signal a short buffer, breaking the network code. Bring it back.
This commit is contained in:
parent
8af503bc85
commit
fdc0c5f654
12
src/pkt.c
12
src/pkt.c
@ -188,10 +188,8 @@ int git_pkt_parse_line(
|
|||||||
int32_t len;
|
int32_t len;
|
||||||
|
|
||||||
/* Not even enough for the length */
|
/* Not even enough for the length */
|
||||||
if (bufflen > 0 && bufflen < PKT_LEN_SIZE) {
|
if (bufflen > 0 && bufflen < PKT_LEN_SIZE)
|
||||||
giterr_set(GITERR_NET, "Insufficient buffer data");
|
return GIT_ESHORTBUFFER;
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
len = parse_len(line);
|
len = parse_len(line);
|
||||||
if (len < 0) {
|
if (len < 0) {
|
||||||
@ -211,10 +209,8 @@ int git_pkt_parse_line(
|
|||||||
* If we were given a buffer length, then make sure there is
|
* If we were given a buffer length, then make sure there is
|
||||||
* enough in the buffer to satisfy this line
|
* enough in the buffer to satisfy this line
|
||||||
*/
|
*/
|
||||||
if (bufflen > 0 && bufflen < (size_t)len) {
|
if (bufflen > 0 && bufflen < (size_t)len)
|
||||||
giterr_set(GITERR_NET, "Insufficient buffer data for packet length");
|
return GIT_ESHORTBUFFER;
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
line += PKT_LEN_SIZE;
|
line += PKT_LEN_SIZE;
|
||||||
/*
|
/*
|
||||||
|
Loading…
Reference in New Issue
Block a user