MIME_BOUNDARY_DASHES is now the number of leading dashes in the
generated boundary string.
Closes #8441
mime->firstpart = NULL;
mime->lastpart = NULL;
- memset(mime->boundary, '-', 24);
- if(Curl_rand_hex(easy, (unsigned char *) &mime->boundary[24],
+ memset(mime->boundary, '-', MIME_BOUNDARY_DASHES);
+ if(Curl_rand_hex(easy,
+ (unsigned char *) &mime->boundary[MIME_BOUNDARY_DASHES],
MIME_RAND_BOUNDARY_CHARS + 1)) {
/* failed to get random separator, bail out */
free(mime);
#include "curl_setup.h"
+#define MIME_BOUNDARY_DASHES 24 /* leading boundary dashes */
#define MIME_RAND_BOUNDARY_CHARS 16 /* Nb. of random boundary chars. */
#define MAX_ENCODED_LINE_LENGTH 76 /* Maximum encoded line length. */
#define ENCODING_BUFFER_SIZE 256 /* Encoding temp buffers size. */
};
/* Boundary string length. */
-#define MIME_BOUNDARY_LEN (24 + MIME_RAND_BOUNDARY_CHARS)
+#define MIME_BOUNDARY_LEN (MIME_BOUNDARY_DASHES + MIME_RAND_BOUNDARY_CHARS)
/* A mime multipart. */
struct curl_mime {