[gnome-online-accounts/gnome-3-12] inquiry: fix edge case when answer is full size of reply buffer
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-online-accounts/gnome-3-12] inquiry: fix edge case when answer is full size of reply buffer
- Date: Wed, 12 Nov 2014 14:33:24 +0000 (UTC)
commit 927d24b9c018161aea46ca47d1a2b50bbb0e9224
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 70952b1..36d9163 100644
--- a/src/goaidentity/goakerberosidentityinquiry.c
+++ b/src/goaidentity/goakerberosidentityinquiry.c
@@ -298,8 +298,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]