From 992e05ecba26e6bb760de25a8c7e6e3ec75b6731 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 26 Aug 2022 13:58:18 +0200 Subject: [PATCH] Check address book URI length before creation Signed-off-by: Joas Schilling --- apps/dav/lib/CardDAV/CardDavBackend.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apps/dav/lib/CardDAV/CardDavBackend.php b/apps/dav/lib/CardDAV/CardDavBackend.php index 1c1754ff752..ebbf44376f5 100644 --- a/apps/dav/lib/CardDAV/CardDavBackend.php +++ b/apps/dav/lib/CardDAV/CardDavBackend.php @@ -416,6 +416,10 @@ class CardDavBackend implements BackendInterface, SyncSupport { * @throws BadRequest */ public function createAddressBook($principalUri, $url, array $properties) { + if (strlen($url) > 255) { + throw new BadRequest('URI too long. Address book not created'); + } + $values = [ 'displayname' => null, 'description' => null, -- 2.39.5