Commit 36ab5c4e authored by Bkg2k's avatar Bkg2k

Fix out-of-buffer hexa strings.

parent 00591238
......@@ -172,7 +172,8 @@ bool MetadataDescriptor::RangeToInt(const std::string& range, int& to)
bool MetadataDescriptor::IntToHex(int from, std::string& to)
{
static const char* hexa = "0123456789ABCDEF";
char result[8];
char result[9];
result[sizeof(result) - 1] = 0;
for(int i = sizeof(result), p = 0; -- i >= 0;)
result[p++] = hexa[(from >> (i << 2)) & 0xF];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment