diff options
author | Edward Thomson <ethomson@microsoft.com> | 2013-05-29 16:03:30 -0500 |
---|---|---|
committer | Edward Thomson <ethomson@microsoft.com> | 2013-05-29 16:26:25 -0500 |
commit | 2d160ef782c812bd7d68413a00a62f46585725d0 (patch) | |
tree | c771fbfe1bc5a8a6dc47c0f14b5e94936b7bbcde /src/pool.c | |
parent | 17776314c8d161d78917e5fb2805d78a3c8c3599 (diff) | |
download | libgit2-2d160ef782c812bd7d68413a00a62f46585725d0.tar.gz |
allow (ignore) bare slash in gitignore
Diffstat (limited to 'src/pool.c')
-rw-r--r-- | src/pool.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/pool.c b/src/pool.c index b3cd49665..d484769e9 100644 --- a/src/pool.c +++ b/src/pool.c @@ -194,6 +194,11 @@ char *git_pool_strndup(git_pool *pool, const char *str, size_t n) assert(pool && str && pool->item_size == sizeof(char)); + if (n + 1 == 0) { + giterr_set_oom(); + return NULL; + } + if ((ptr = git_pool_malloc(pool, (uint32_t)(n + 1))) != NULL) { memcpy(ptr, str, n); *(((char *)ptr) + n) = '\0'; |