[gnome-online-accounts] inquiry: fix edge case when answer is full size of reply buffer
- From: Ray Strode <halfline src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-online-accounts] inquiry: fix edge case when answer is full size of reply buffer
- Date: Wed, 5 Nov 2014 19:07:20 +0000 (UTC)
commit 524ea19374ac7d65b5c889ee212ee1daee1e1947
Author: Ray Strode <rstrode redhat com>
Date: Tue Nov 4 09:48:49 2014 -0500
inquiry: fix edge case when answer is full size of reply buffer
Right now if the user's answer is 1024 bytes exactly then we'll
call strlen() on an unterminated string.
This commit addresses the issue by avoiding the strlen() call and
instead using the already computed length.
https://bugzilla.gnome.org/show_bug.cgi?id=739593
src/goaidentity/goakerberosidentityinquiry.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
---
diff --git a/src/goaidentity/goakerberosidentityinquiry.c b/src/goaidentity/goakerberosidentityinquiry.c
index f900197..7c9a84a 100644
--- a/src/goaidentity/goakerberosidentityinquiry.c
+++ b/src/goaidentity/goakerberosidentityinquiry.c
@@ -296,8 +296,7 @@ goa_kerberos_identity_inquiry_answer_query (GoaIdentityInquiry * inquiry,
{
strncpy (kerberos_query->kerberos_prompt->reply->data,
answer, kerberos_query->kerberos_prompt->reply->length);
- kerberos_query->kerberos_prompt->reply->length =
- (unsigned int) strlen (kerberos_query->kerberos_prompt->reply->data);
+ kerberos_query->kerberos_prompt->reply->length = (unsigned int) answer_length;
goa_kerberos_identity_inquiry_mark_query_answered (self, kerberos_query);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]