[evolution-data-server] NUL-terminate literal strings when tokenising



commit 8f7c68e2b108da7059e8aaba00f78ea0abc773e0
Author: David Woodhouse <David Woodhouse intel com>
Date:   Mon Jun 21 11:08:59 2010 +0100

    NUL-terminate literal strings when tokenising

 camel/providers/imapx/camel-imapx-stream.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/camel/providers/imapx/camel-imapx-stream.c b/camel/providers/imapx/camel-imapx-stream.c
index c63cdc3..d6102a6 100644
--- a/camel/providers/imapx/camel-imapx-stream.c
+++ b/camel/providers/imapx/camel-imapx-stream.c
@@ -302,6 +302,7 @@ camel_imapx_stream_astring(CamelIMAPXStream *is, guchar **data, CamelException *
 			memcpy(p, start, inlen);
 			p += inlen;
 		} while (ret > 0);
+		*p = 0;
 		*data = is->tokenptr;
 		return 0;
 	case IMAPX_TOK_ERROR:
@@ -340,6 +341,7 @@ camel_imapx_stream_nstring(CamelIMAPXStream *is, guchar **data, CamelException *
 			memcpy(p, start, inlen);
 			p += inlen;
 		} while (ret > 0);
+		*p = 0;
 		*data = is->tokenptr;
 		return 0;
 	case IMAPX_TOK_TOKEN:



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