0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-07-01 16:28:19 +02:00

modules/media: Add checks for empty parameters / bogus file room hash.

This commit is contained in:
Jason Volk 2018-04-21 00:53:08 -07:00
parent 79e2e698e0
commit d35a0190f7

View file

@ -20,6 +20,12 @@ m::room::id::buf
file_room_id(const string_view &server, file_room_id(const string_view &server,
const string_view &file) const string_view &file)
{ {
if(empty(server) || empty(file))
throw m::BAD_REQUEST
{
"Invalid MXC: empty server or file parameters..."
};
size_t len; size_t len;
thread_local char buf[512]; thread_local char buf[512];
len = strlcpy(buf, server); len = strlcpy(buf, server);