mirror of
https://github.com/matrix-construct/construct
synced 2025-01-13 16:33:53 +01:00
modules/media: Add checks for empty parameters / bogus file room hash.
This commit is contained in:
parent
79e2e698e0
commit
d35a0190f7
1 changed files with 6 additions and 0 deletions
|
@ -20,6 +20,12 @@ m::room::id::buf
|
|||
file_room_id(const string_view &server,
|
||||
const string_view &file)
|
||||
{
|
||||
if(empty(server) || empty(file))
|
||||
throw m::BAD_REQUEST
|
||||
{
|
||||
"Invalid MXC: empty server or file parameters..."
|
||||
};
|
||||
|
||||
size_t len;
|
||||
thread_local char buf[512];
|
||||
len = strlcpy(buf, server);
|
||||
|
|
Loading…
Reference in a new issue