From 6811f77cdd926b6eb42b3dfacae6946667314426 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Sun, 21 Jun 2015 20:02:01 -0700 Subject: Fix incorrect buffer length calculation Oops, this is bad as it will lead to a certain buffer overrun. The other change is more cosmetic - nested open comment '/*'. Signed-off-by: Dirk Hohndel --- git-access.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'git-access.c') diff --git a/git-access.c b/git-access.c index e5029f62a..062152b0a 100644 --- a/git-access.c +++ b/git-access.c @@ -215,7 +215,7 @@ static int check_remote_status(git_repository *repo, git_remote *origin, const c if (git_branch_upstream(&remote_ref, local_ref)) { /* so there is no upstream branch for our branch; that's a problem. - /* let's push our branch */ + * let's push our branch */ git_strarray refspec; git_reference_list(&refspec, repo); #if USE_LIBGIT23_API @@ -374,7 +374,7 @@ static git_repository *create_local_repo(const char *localdir, const char *remot error = git_clone(&cloned_repo, remote, localdir, &opts); if (error) { char *msg = giterr_last()->message; - int len = sizeof("Reference 'refs/remotes/origin/' not found" + strlen(branch)); + int len = sizeof("Reference 'refs/remotes/origin/' not found") + strlen(branch); char *pattern = malloc(len); snprintf(pattern, len, "Reference 'refs/remotes/origin/%s' not found", branch); if (strstr(remote, prefs.cloud_git_url) && strstr(msg, pattern)) { -- cgit v1.2.3-70-g09d2