summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Martín Nieto <carlos@cmartin.tk>2012-04-29 01:20:02 +0200
committerCarlos Martín Nieto <carlos@cmartin.tk>2012-04-29 01:21:53 +0200
commitfdc0c5f6548b44d6fbe1eb9a0d38a8ef5aae2b86 (patch)
treef68c13b32c0962c4b66ddf65aad4f4d98711c781
parent8af503bc85a92242bd698cca1e8594af909811c6 (diff)
downloadlibgit2-fdc0c5f6548b44d6fbe1eb9a0d38a8ef5aae2b86.tar.gz
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.
-rw-r--r--src/pkt.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/pkt.c b/src/pkt.c
index 2c9fe27da..ae7a40860 100644
--- a/src/pkt.c
+++ b/src/pkt.c
@@ -188,10 +188,8 @@ int git_pkt_parse_line(
int32_t len;
/* Not even enough for the length */
- if (bufflen > 0 && bufflen < PKT_LEN_SIZE) {
- giterr_set(GITERR_NET, "Insufficient buffer data");
- return -1;
- }
+ if (bufflen > 0 && bufflen < PKT_LEN_SIZE)
+ return GIT_ESHORTBUFFER;
len = parse_len(line);
if (len < 0) {
@@ -211,10 +209,8 @@ int git_pkt_parse_line(
* If we were given a buffer length, then make sure there is
* enough in the buffer to satisfy this line
*/
- if (bufflen > 0 && bufflen < (size_t)len) {
- giterr_set(GITERR_NET, "Insufficient buffer data for packet length");
- return -1;
- }
+ if (bufflen > 0 && bufflen < (size_t)len)
+ return GIT_ESHORTBUFFER;
line += PKT_LEN_SIZE;
/*