[gmime: 3/6] Fix off-by-one out-of-bounds read in g_mime_charset_canon_name()



commit e3643db0c587b6ac5fa4c3bdb01d766f7d6af9eb
Author: Jakub Wilk <jwilk jwilk net>
Date:   Sat Oct 7 20:40:14 2017 +0200

    Fix off-by-one out-of-bounds read in g_mime_charset_canon_name()

 gmime/gmime-charset.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/gmime/gmime-charset.c b/gmime/gmime-charset.c
index dac7090..7343dcc 100644
--- a/gmime/gmime-charset.c
+++ b/gmime/gmime-charset.c
@@ -587,7 +587,7 @@ g_mime_charset_canon_name (const char *charset)
                if (endptr == ptr || *endptr != '\0')
                        return charset;
                
-               if (iso > G_N_ELEMENTS (iso_charsets))
+               if (iso >= G_N_ELEMENTS (iso_charsets))
                        return charset;
                
                return iso_charsets[iso];


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