git.99rst.org
/
git.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
| inline |
side by side
(parent:
fb27637
)
contrib/git-credential-gnome-keyring.c: ensure buffer is non-empty before accessing
author
Brandon Casey
<redacted>
Mon, 23 Sep 2013 18:49:08 +0000
(11:49 -0700)
committer
Junio C Hamano
<redacted>
Wed, 16 Oct 2013 16:35:31 +0000
(09:35 -0700)
Ensure buffer length is non-zero before attempting to access the last
element.
Signed-off-by: Brandon Casey <redacted>
Signed-off-by: Junio C Hamano <redacted>
contrib/credential/gnome-keyring/git-credential-gnome-keyring.c
patch
|
blob
|
history
diff --git
a/contrib/credential/gnome-keyring/git-credential-gnome-keyring.c
b/contrib/credential/gnome-keyring/git-credential-gnome-keyring.c
index b9bb794601784f9eb06afa26ded0e5efffba8d8e..0d2c55e0d22a1e1dd88f48f67e6c63ccaf652191 100644
(file)
--- a/
contrib/credential/gnome-keyring/git-credential-gnome-keyring.c
+++ b/
contrib/credential/gnome-keyring/git-credential-gnome-keyring.c
@@
-314,7
+314,7
@@
static int credential_read(struct credential *c)
{
line_len = strlen(buf);
- if (
buf[line_len-1]==
'\n')
+ if (
line_len && buf[line_len-1] ==
'\n')
buf[--line_len]='\0';
if (!line_len)
git clone https://git.99rst.org/PROJECT