Assert a filename in indexer creation

Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
This commit is contained in:
Carlos Martín Nieto 2011-08-07 10:26:33 +02:00 committed by Vicent Marti
parent 7284c1059f
commit ade3c9bb88

View File

@ -102,6 +102,8 @@ int git_indexer_new(git_indexer **out, const char *packname)
unsigned int namelen; unsigned int namelen;
int ret, error; int ret, error;
assert(out && packname);
if (git_path_root(packname) < 0) if (git_path_root(packname) < 0)
return git__throw(GIT_EINVALIDPATH, "Path is not absolute"); return git__throw(GIT_EINVALIDPATH, "Path is not absolute");