From 7632e2494a5b8bfea41e7fbfaa0fc324e2178932 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn=20Nieto?= Date: Mon, 13 Jun 2011 23:01:12 +0200 Subject: Correctly handle network input Add a parameter to git_pkt_parse_line to tell it how much data you have in your buffer. If the buffer is too short, it returns an error saying so. Adapt the git transport to use this and fix the offset calculation. Add the GIT_ESHORTBUFFER error code. --- include/git2/errors.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include/git2/errors.h') diff --git a/include/git2/errors.h b/include/git2/errors.h index 334b9edab..03c74e822 100644 --- a/include/git2/errors.h +++ b/include/git2/errors.h @@ -128,6 +128,9 @@ typedef enum { /** The path pattern and string did not match */ GIT_ENOMATCH = -31, + + /** The buffer is too short to satisfy the request */ + GIT_ESHORTBUFFER = -32, } git_error; /** -- cgit v1.2.1