Commit 59ae37db authored by Lotrado's avatar Lotrado
Browse files

Use snprintf instead of sprintf to avoid security warnings regarding buffer...

Use snprintf instead of sprintf to avoid security warnings regarding buffer overflow potential of sprintf.
parent eb43c16b
......@@ -380,7 +380,7 @@ namespace mirrage::util {
char buf[33];
for(int i = 0; i < 16; i++)
sprintf(buf + i * 2, "%02x", digest[i]);
snprintf(buf + i * 2, 33 - i * 2, "%02x", digest[i]);
buf[32] = 0;
return std::string(buf);
......
Supports Markdown
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