|
|
|
@ -463,7 +463,7 @@ int base64decode(std::string input, char **obuffer, int *olen) {
|
|
|
|
|
|
|
|
|
|
|
|
// calculate and realloc size of buffer
|
|
|
|
// calculate and realloc size of buffer
|
|
|
|
if (*obuffer == NULL || (1 + ilen*3/4) < *olen) {
|
|
|
|
if (*obuffer == NULL || (1 + ilen*3/4) < *olen) {
|
|
|
|
*olen = 1 + ilen*3/4;
|
|
|
|
*olen = 2 + ilen*3/4; // increase buffer by two ... null terminated string?
|
|
|
|
*obuffer = (char*) realloc(*obuffer, *olen);
|
|
|
|
*obuffer = (char*) realloc(*obuffer, *olen);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -493,6 +493,7 @@ int base64decode(std::string input, char **obuffer, int *olen) {
|
|
|
|
(*obuffer)[ocnt++] = c;
|
|
|
|
(*obuffer)[ocnt++] = c;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
*olen = ocnt;
|
|
|
|
*olen = ocnt;
|
|
|
|
|
|
|
|
(*obuffer)[ocnt] = 0; // nullterminate - just to prevent unseen stuff
|
|
|
|
return 1;
|
|
|
|
return 1;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|