[tin-dev] [PATCH] RFC 2231 Parameter Value Continuations Fix

Dennis Preiser dennis at d--p.de
Mon Dec 28 21:14:35 CET 2015


Problem:
tin crashes when part number zero ('*0') is absent.

Solution:
Make sure that we use the first available part as starting point.

Dennis
-------------- next part --------------
--- tin-2.3.2_r1/src/rfc2046.c	2015-12-24 09:52:24.000000000 +0100
+++ tin-2.3.2_r2/src/rfc2046.c	2015-12-28 20:15:59.000000000 +0100
@@ -419,7 +419,7 @@ get_param(
 				newlen = 0;
 				for (j = 0, c_list = list; c_list != NULL; c_list = c_list->next) {
 					if (strcasecmp(name, c_list->name) == 0) {
-						if (c_list->part == 0)
+						if (c_list->part < p_list->part)
 							p_list = c_list;
 
 						newlen += strlen(c_list->value);
@@ -427,7 +427,7 @@ get_param(
 					}
 				}
 				p_list->value = my_realloc(p_list->value, newlen + 1);
-				for (i = 1; i <= j; ++i) {
+				for (i = p_list->part + 1; i <= j; ++i) {
 					for (c_list = list; c_list != NULL; c_list = c_list->next) {
 						if (strcasecmp(name, c_list->name) == 0) {
 							if (c_list->part == i) {


More information about the tin-dev mailing list