-/* $Cambridge: exim/src/src/mime.c,v 1.9 2005/07/01 10:49:02 ph10 Exp $ */
+/* $Cambridge: exim/src/src/mime.c,v 1.12 2005/08/16 12:32:32 tom Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
/* byte 0 ---------------------- */
if (*(p+1) == 255) {
- mime_set_anomaly(MIME_ANOMALY_BROKEN_BASE64);
break;
}
data[(*num_decoded)] = *p;
p++;
/* byte 1 ---------------------- */
if (*(p+1) == 255) {
- mime_set_anomaly(MIME_ANOMALY_BROKEN_BASE64);
break;
}
data[(*num_decoded)] = *p;
p++;
/* byte 2 ---------------------- */
if (*(p+1) == 255) {
- mime_set_anomaly(MIME_ANOMALY_BROKEN_BASE64);
break;
}
data[(*num_decoded)] = *p;
filename = (uschar *)malloc(2048);
if ((pname != NULL) && (fname != NULL)) {
- snprintf(CS filename, 2048, "%s/%s", pname, fname);
+ (void)string_format(filename, 2048, "%s/%s", pname, fname);
f = fopen(CS filename,"wb+");
}
else if (pname == NULL) {
/* must find first free sequential filename */
do {
struct stat mystat;
- snprintf(CS filename,2048,"%s/%s-%05u", pname, message_id, file_nr);
+ (void)string_format(filename,2048,"%s/%s-%05u", pname, message_id, file_nr);
file_nr++;
/* security break */
if (file_nr >= 1024)
f_pos = ftell(mime_stream);
/* build default decode path (will exist since MBOX must be spooled up) */
- snprintf(CS decode_path,1024,"%s/scan/%s",spool_directory,message_id);
+ (void)string_format(decode_path,1024,"%s/scan/%s",spool_directory,message_id);
/* reserve a line and decoder buffer to work in */
buffer = (uschar *)malloc(MIME_MAX_LINE_LENGTH+1);
};
};
- if (header[num_copied-1] != ';') {
+ if ((num_copied > 0) && (header[num_copied-1] != ';')) {
header[num_copied-1] = ';';
};
/* must find first free sequential filename */
do {
struct stat mystat;
- snprintf(CS filename,2048,"%s/scan/%s/__rfc822_%05u", spool_directory, message_id, file_nr);
+ (void)string_format(filename,2048,"%s/scan/%s/__rfc822_%05u", spool_directory, message_id, file_nr);
file_nr++;
/* security break */
if (file_nr >= 128)