path: use GITERR_CHECK_ALLOC_BUF to verify passed in buffer

This commit is contained in:
Patrick Steinhardt 2016-02-23 10:02:44 +01:00
parent 859ed5ddc7
commit 42c05ed56b

View File

@ -705,8 +705,7 @@ int git_path_resolve_relative(git_buf *path, size_t ceiling)
char *base, *to, *from, *next; char *base, *to, *from, *next;
size_t len; size_t len;
if (!path || git_buf_oom(path)) GITERR_CHECK_ALLOC_BUF(path);
return -1;
if (ceiling > path->size) if (ceiling > path->size)
ceiling = path->size; ceiling = path->size;