Andrew's git
/
gitweb.git
/ blobdiff
summary
|
log
|
commit
|
diff
|
tree
commit
grep
author
committer
pickaxe
?
re
validate_headref: NUL-terminate HEAD buffer
[gitweb.git]
/
path.c
diff --git
a/path.c
b/path.c
index e50d2befcf826680c70ac59295c06004dd6221cf..1ca2cf9a289731174c8e7d4ff0e790e0be1d9f18 100644
(file)
--- a/
path.c
+++ b/
path.c
@@
-661,6
+661,10
@@
int validate_headref(const char *path)
len = read_in_full(fd, buffer, sizeof(buffer)-1);
close(fd);
+ if (len < 0)
+ return -1;
+ buffer[len] = '\0';
+
/*
* Is it a symbolic ref?
*/