[git] GnuPG - branch, master, updated. gnupg-2.1.0beta3-237-gb6d54f1
by NIIBE Yutaka
cvs at cvs.gnupg.org
Tue Aug 27 05:03:33 CEST 2013
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The GNU Privacy Guard".
The branch, master has been updated
via b6d54f1196d5f110fd94dfd661e74dbc60ca9811 (commit)
from 54cbab29c700db2df74e808f16db49170e6c42f1 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit b6d54f1196d5f110fd94dfd661e74dbc60ca9811
Author: NIIBE Yutaka <gniibe at fsij.org>
Date: Tue Aug 27 10:23:09 2013 +0900
scd: fix parsing login-data DO.
* scd/app-openpgp.c (parse_login_data): Release RELPTR. Fix parsing.
--
Signed-off-by: NIIBE Yutaka
diff --git a/scd/app-openpgp.c b/scd/app-openpgp.c
index 673570d..011c248 100644
--- a/scd/app-openpgp.c
+++ b/scd/app-openpgp.c
@@ -660,7 +660,11 @@ parse_login_data (app_t app)
if (*buffer == '\n')
break;
if (buflen < 2 || buffer[1] != '\x14')
- return; /* No control sequences. */
+ {
+ xfree (relptr);
+ return; /* No control sequences. */
+ }
+
buflen--;
buffer++;
do
@@ -707,14 +711,11 @@ parse_login_data (app_t app)
m = strtol (q, &q, 10);
}
- buffer = q;
if (buflen < ((unsigned char *)q - buffer))
- {
- buflen = 0;
- break;
- }
- else
- buflen -= ((unsigned char *)q - buffer);
+ break;
+
+ buflen -= ((unsigned char *)q - buffer);
+ buffer = q;
if (buflen && !(*buffer == '\n' || *buffer == '\x18'))
goto next;
@@ -725,11 +726,11 @@ parse_login_data (app_t app)
}
}
next:
- for (; buflen && *buffer != '\x18'; buflen--, buffer++)
- if (*buffer == '\n')
- buflen = 1;
+ /* Skip to FS (0x18) or LF (\n). */
+ for (; buflen && *buffer != '\x18' && *buffer != '\n'; buflen--)
+ buffer++;
}
- while (buflen);
+ while (buflen && *buffer != '\n');
xfree (relptr);
}
-----------------------------------------------------------------------
Summary of changes:
scd/app-openpgp.c | 25 +++++++++++++------------
1 files changed, 13 insertions(+), 12 deletions(-)
hooks/post-receive
--
The GNU Privacy Guard
http://git.gnupg.org
More information about the Gnupg-commits
mailing list