[gmime] Enable RFC 2047 compliance check for all headers (#44)



commit 54b78180275b1b2e00dba8664207eb1f8ae94be3
Author: albrechtd <albrecht dress arcor de>
Date:   Wed Jan 31 21:58:51 2018 +0100

    Enable RFC 2047 compliance check for all headers (#44)

 gmime/gmime-object.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/gmime/gmime-object.c b/gmime/gmime-object.c
index 54fa34a..f160aa8 100644
--- a/gmime/gmime-object.c
+++ b/gmime/gmime-object.c
@@ -195,12 +195,17 @@ static void
 object_header_changed (GMimeObject *object, GMimeHeader *header)
 {
        GMimeParserOptions *options = _g_mime_header_list_get_options (object->headers);
+       gboolean can_warn = g_mime_parser_options_get_warning_callback (options) != NULL;
        GMimeContentDisposition *disposition;
        GMimeContentType *content_type;
        const char *name, *value;
        guint i;
        
        name = g_mime_header_get_name (header);
+
+       /* validate header if requested, caches the decoded value */
+       if (G_UNLIKELY (can_warn))
+               g_mime_header_get_value (header);
        
        if (g_ascii_strncasecmp (name, "Content-", 8) != 0)
                return;


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