summaryrefslogtreecommitdiff
path: root/include/git2/submodule.h
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2014-03-26 14:38:26 -0700
committerRussell Belfer <rb@github.com>2014-03-26 14:38:26 -0700
commit22df47cbc52107db25368cf0a09d63cc8dddafdb (patch)
tree78c4053629bc5b34abc0626f3d2075ddddcc9837 /include/git2/submodule.h
parentf4afcaa0d50bece4a784ce680d92e5c0d1c67785 (diff)
downloadlibgit2-22df47cbc52107db25368cf0a09d63cc8dddafdb.tar.gz
Fix segfault if gitmodules is invalid
The reload_all call could end up dereferencing a NULL pointer if there was an error while attempting to load the submodules config data (i.e. invalid content in the gitmodules file). This fixes it.
Diffstat (limited to 'include/git2/submodule.h')
-rw-r--r--include/git2/submodule.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/git2/submodule.h b/include/git2/submodule.h
index 789f2c045..28e235725 100644
--- a/include/git2/submodule.h
+++ b/include/git2/submodule.h
@@ -115,8 +115,8 @@ typedef enum {
*
* - The submodule is not mentioned in the HEAD, the index, and the config,
* but does "exist" in the working directory (i.e. there is a subdirectory
- * that is a valid self-contained git repo). In this case, this function
- * returns GIT_EEXISTS to indicate the the submodule exists but not in a
+ * that appears to be a Git repository). In this case, this function
+ * returns GIT_EEXISTS to indicate a sub-repository exists but not in a
* state where a git_submodule can be instantiated.
* - The submodule is not mentioned in the HEAD, index, or config and the
* working directory doesn't contain a value git repo at that path.
@@ -129,7 +129,7 @@ typedef enum {
* @param repo The parent repository
* @param name The name of or path to the submodule; trailing slashes okay
* @return 0 on success, GIT_ENOTFOUND if submodule does not exist,
- * GIT_EEXISTS if submodule exists in working directory only,
+ * GIT_EEXISTS if a repository is found in working directory only,
* -1 on other errors.
*/
GIT_EXTERN(int) git_submodule_lookup(