about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--rfc2045.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/rfc2045.c b/rfc2045.c
index 2a6376b..df48d57 100644
--- a/rfc2045.c
+++ b/rfc2045.c
@@ -182,6 +182,9 @@ blaze822_walk_mime(struct message *msg, int depth, blaze822_mime_callback visit)
 
 	blaze822_mime_action r = MIME_CONTINUE;
 
+	if (depth > 64)
+		return MIME_PRUNE;
+
 	if (blaze822_mime_body(msg, &ct, &body, &bodylen, &bodychunk)) {
 
 		r = visit(depth, msg, body, bodylen);