comparison src/libstrfunc.c @ 110:7133b39975f7 stable-0-6-22

patch from David Cuadrado to process emails with type PST_TYPE_OTHER base64_encode_multiple() may insert newline, needs larger malloc subject lines shorter than 2 bytes could segfault
author Carl Byington <carl@five-ten-sg.com>
date Fri, 28 Nov 2008 11:36:53 -0800
parents 997cf1373f9e
children ab2a11e72250
comparison
equal deleted inserted replaced
109:7947334d53ad 110:7133b39975f7
34 unsigned char *p = (unsigned char *)data; 34 unsigned char *p = (unsigned char *)data;
35 unsigned char *dte = p + size; 35 unsigned char *dte = p + size;
36 36
37 if (data == NULL || size == 0) return NULL; 37 if (data == NULL || size == 0) return NULL;
38 38
39 ou = output = (char *)malloc(size / 3 * 4 + (size / 57) + 5); 39 ou = output = (char *)malloc(size / 3 * 4 + (size / 57) + 6);
40 if (!output) return NULL; 40 if (!output) return NULL;
41 41
42 while((dte-p) >= 3) { 42 while((dte-p) >= 3) {
43 unsigned char x = p[0]; 43 unsigned char x = p[0];
44 unsigned char y = p[1]; 44 unsigned char y = p[1];