[evolution-data-server] Fix read off end of string in NTLM SSO support



commit 8ed94aae34ba003487b76b58c879506b57d19200
Author: David Woodhouse <David Woodhouse intel com>
Date:   Sat Apr 9 21:39:25 2011 +0100

    Fix read off end of string in NTLM SSO support
    
    Didn't actually break things, since the base64 decode usually just gave us
    an extra few bytes before hitting a character it didn't like and stopping
    anyway, but naughty nonetheless. Valgrind told me off for it, and rightly so.

 camel/camel-sasl-ntlm.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
---
diff --git a/camel/camel-sasl-ntlm.c b/camel/camel-sasl-ntlm.c
index 74cc23d..f51d305 100644
--- a/camel/camel-sasl-ntlm.c
+++ b/camel/camel-sasl-ntlm.c
@@ -707,6 +707,7 @@ sasl_ntlm_challenge_sync (CamelSasl *sasl,
 				   sizeof(buf), cancellable, NULL)) > 4 &&
 			   buf[0] == 'K' && buf[1] == 'K' && buf[2] == ' ' &&
 			   buf[s-1] == '\n') {
+				buf[s-1] = 0;
 				data = g_base64_decode (buf + 3, &length);
 				g_byte_array_append (ret, data, length);
 				g_free (data);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]