File tree Expand file tree Collapse file tree 2 files changed +17
-12
lines changed Expand file tree Collapse file tree 2 files changed +17
-12
lines changed Original file line number Diff line number Diff line change @@ -7,8 +7,8 @@ HYPERMAIL VERSION 2.4.0:
7
7
2019-12-19 Jose Kahan
8
8
* src/parse.c
9
9
parsemail(): a Content-Transfer-Encoding header with a missing value
10
- would output a random string when generating unsupported encoding
11
- body message.
10
+ would result in an unitialized variable being used to output an unknown
11
+ encoding warning message. Hypermail now skips this header if it's empty .
12
12
13
13
2019-11-22 Jose Kahan
14
14
* src/print.c
Original file line number Diff line number Diff line change @@ -2467,18 +2467,23 @@ int parsemail(char *mbox, /* file name */
2467
2467
char code [64 ];
2468
2468
2469
2469
/* is there any value for content-encoding or is it missing? */
2470
- if (* ptr ) {
2471
- sscanf (ptr , "%63s" , code );
2470
+ if (sscanf (ptr , "%63s" , code ) != EOF ) {
2471
+
2472
+ snprintf (line , sizeof (line_buf ) - set_ietf_mbox ,
2473
+ " ('%s' %s)\n" , code ,
2474
+ lang [MSG_ENCODING_IS_NOT_SUPPORTED ]);
2475
+
2476
+ bp = addbody (bp , & lp , line ,
2477
+ BODY_HTMLIZED | bodyflags );
2478
+
2479
+ #if DEBUG_PARSE
2480
+ printf ("Ignoring unknown Content-Transfer-Encoding: %s\n" , code );
2481
+ #endif
2472
2482
} else {
2473
- code [0 ] = '\0' ;
2483
+ #if DEBUG_PARSE
2484
+ printf ("Missing Content-Transfer-Encoding value\n" );
2485
+ #endif
2474
2486
}
2475
-
2476
- snprintf (line , sizeof (line_buf ) - set_ietf_mbox ,
2477
- " ('%s' %s)\n" , code ,
2478
- lang [MSG_ENCODING_IS_NOT_SUPPORTED ]);
2479
-
2480
- bp = addbody (bp , & lp , line ,
2481
- BODY_HTMLIZED | bodyflags );
2482
2487
}
2483
2488
#if DEBUG_PARSE
2484
2489
printf ("DECODE set to %d\n" , decode );
You can’t perform that action at this time.
0 commit comments