mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-23 21:55:03 +02:00
parent
0a6f15c475
commit
e80b335edf
@ -561,6 +561,7 @@ String RandomString(int length)
|
|||||||
sprintf(output + 2 * i, "%02x", bytes[i]);
|
sprintf(output + 2 * i, "%02x", bytes[i]);
|
||||||
|
|
||||||
String result = output;
|
String result = output;
|
||||||
|
delete [] bytes;
|
||||||
delete [] output;
|
delete [] output;
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
@ -39,7 +39,7 @@ String Base64::Encode(const String& input)
|
|||||||
|
|
||||||
String ret = String(outbuf, outbuf + len);
|
String ret = String(outbuf, outbuf + len);
|
||||||
BIO_free_all(bio64);
|
BIO_free_all(bio64);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -59,7 +59,8 @@ String Base64::Decode(const String& input)
|
|||||||
|
|
||||||
String ret = String(outbuf, outbuf + len);
|
String ret = String(outbuf, outbuf + len);
|
||||||
BIO_free_all(bio64);
|
BIO_free_all(bio64);
|
||||||
|
delete [] outbuf;
|
||||||
|
|
||||||
if (ret.IsEmpty() && !input.IsEmpty())
|
if (ret.IsEmpty() && !input.IsEmpty())
|
||||||
throw std::invalid_argument("Not a valid base64 string");
|
throw std::invalid_argument("Not a valid base64 string");
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user