projects
/
mmh
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
3480eff
)
mhshow: Fixed segfault. (Care that c_charset is set.)
author
markus schnalke
<meillo@marmaro.de>
Sat, 14 Apr 2012 20:09:52 +0000
(22:09 +0200)
committer
markus schnalke
<meillo@marmaro.de>
Sat, 14 Apr 2012 20:09:52 +0000
(22:09 +0200)
uip/mhshowsbr.c
patch
|
blob
|
history
diff --git
a/uip/mhshowsbr.c
b/uip/mhshowsbr.c
index
3bcf84f
..
4f67d32
100644
(file)
--- a/
uip/mhshowsbr.c
+++ b/
uip/mhshowsbr.c
@@
-312,9
+312,8
@@
show_content_aux(CT ct, int alternate, char *cp, char *cracked)
case 'c':
/* insert charset */
case 'c':
/* insert charset */
- if (ct->c_charset) {
- strncpy(bp, ct->c_charset, buflen);
- }
+ strncpy(bp, ct->c_charset ? ct->c_charset :
+ "US-ASCII", buflen);
break;
case 'd':
break;
case 'd':
@@
-513,7
+512,8
@@
show_text(CT ct, int alternate)
** if it is not a text part of a multipart/alternative
*/
if (!alternate || ct->c_subtype == TEXT_PLAIN) {
** if it is not a text part of a multipart/alternative
*/
if (!alternate || ct->c_subtype == TEXT_PLAIN) {
- if (!check_charset(ct->c_charset, strlen(ct->c_charset))) {
+ if (ct->c_charset && !check_charset(ct->c_charset,
+ strlen(ct->c_charset))) {
snprintf(buffer, sizeof(buffer), "%%liconv -f '%s'",
ct->c_charset);
} else {
snprintf(buffer, sizeof(buffer), "%%liconv -f '%s'",
ct->c_charset);
} else {
@@
-714,9
+714,8
@@
show_multi_aux(CT ct, int alternate, char *cp)
case 'c':
/* insert charset */
case 'c':
/* insert charset */
- if (ct->c_charset) {
- strncpy(bp, ct->c_charset, buflen);
- }
+ strncpy(bp, ct->c_charset ? ct->c_charset :
+ "US-ASCII", buflen);
break;
case 'd':
break;
case 'd':