From ea61b6fbcec3d7109dcbd8c74848d1a4aff1fe57 Mon Sep 17 00:00:00 2001 From: Ken Hornstein Date: Wed, 5 Mar 2014 15:11:54 -0500 Subject: [PATCH] Switch over to using the token parser instead of isspace(), and make sure we have our pointer correct when doing an encoded parameter that isn't the first one. --- uip/mhparse.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/uip/mhparse.c b/uip/mhparse.c index 42312120..0d8bf41f 100644 --- a/uip/mhparse.c +++ b/uip/mhparse.c @@ -3403,6 +3403,8 @@ parse_header_attrs (const char *filename, const char *fieldname, free(charset); return NOTOK; } + + dp = vp; } /* @@ -3412,8 +3414,7 @@ parse_header_attrs (const char *filename, const char *fieldname, * length so we can allocate the correct buffer size. */ - for (dp = vp, len = 0; *vp != '\0' && !isspace((unsigned char) *vp); - vp++) { + for (len = 0; istoken(*vp); vp++) { if (*vp == '%') { if (*(vp + 1) == '\0' || !isxdigit((unsigned char) *(vp + 1)) || @@ -3437,7 +3438,7 @@ parse_header_attrs (const char *filename, const char *fieldname, up = valptr = mh_xmalloc(len + 1); - for (vp = dp; *vp != '\0' && !isspace((unsigned char) *vp); vp++) { + for (vp = dp; istoken(*vp); vp++) { if (*vp == '%') { *up++ = decode_qp(*(vp + 1), *(vp + 2)); vp += 2; -- 2.56.0