changeset 2:1857d0d5a7bd

f-demime: fix parsing of Content-* headers
author Mychaela Falconia <falcon@freecalypso.org>
date Sat, 06 May 2023 06:33:26 +0000
parents 05651a1b8ba8
children 7a6cd16689f5
files f-demime/header_end.c
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/f-demime/header_end.c	Sat May 06 06:20:46 2023 +0000
+++ b/f-demime/header_end.c	Sat May 06 06:33:26 2023 +0000
@@ -114,10 +114,11 @@
 parse_content_type(type, subtype, charset, boundary)
 	char *type, *subtype, *charset, *boundary;
 {
-	char *ctstr = cont_type_buf;
+	char *ctstr;
 	char tokbuf[HDR_BUF_SIZE], attr[HDR_BUF_SIZE];
 	int rc;
 
+	ctstr = index(cont_type_buf, ':') + 1;
 	if (gettoken(&ctstr, type) != 1)
 		return(-1);
 	if (gettoken(&ctstr, tokbuf) != '/')
@@ -150,9 +151,10 @@
 parse_content_te(ctetoken)
 	char *ctetoken;
 {
-	char *ctestr = cont_te_buf;
+	char *ctestr;
 	char tokbuf[HDR_BUF_SIZE];
 
+	ctestr = index(cont_te_buf, ':') + 1;
 	if (gettoken(&ctestr, ctetoken) != 1)
 		return(-1);
 	if (gettoken(&ctestr, tokbuf) == 0)