[gmime] Fixed GMIME_UUENCODE_LEN calculation



commit 3fb8f5295c053d71d426db1e4ee1d47bc869f0a8
Author: Jeffrey Stedfast <fejj gnome org>
Date:   Sun Jan 31 21:51:15 2010 -0500

    Fixed GMIME_UUENCODE_LEN calculation
    
    2010-01-31  Jeffrey Stedfast  <fejj novell com>
    
    	* gmime/gmime-encodings.h (GMIME_UUENCODE_LEN): Fixed
    	calculation to prevent possible buffer overflows in
    	g_mime_encoding_flush().

 ChangeLog               |    5 +++++
 gmime/gmime-encodings.h |    2 +-
 2 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 10e268e..b949ec8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-01-31  Jeffrey Stedfast  <fejj novell com>
+
+	* gmime/gmime-encodings.h (GMIME_UUENCODE_LEN): Fixed to prevent
+	possible buffer overflows.
+
 2010-01-30  Jeffrey Stedfast  <fejj novell com>
 
 	* configure.ac: Disabled strict-aliasing to work around subtle
diff --git a/gmime/gmime-encodings.h b/gmime/gmime-encodings.h
index 26c8926..4d6dc96 100644
--- a/gmime/gmime-encodings.h
+++ b/gmime/gmime-encodings.h
@@ -109,7 +109,7 @@ const char *g_mime_content_encoding_to_string (GMimeContentEncoding encoding);
  * Returns: the number of output bytes needed to uuencode an input
  * buffer of size @x.
  **/
-#define GMIME_UUENCODE_LEN(x)      ((size_t) (((((x) + 2) / 45) * 62) + 62))
+#define GMIME_UUENCODE_LEN(x)      ((size_t) (((((x) + 2) / 45) * 62) + 64))
 
 
 /**



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