mirror of
https://github.com/matrix-construct/construct
synced 2024-10-01 21:28:53 +02: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,
|
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);
|
||||||
|
|
Loading…
Reference in a new issue