]> source.dussan.org Git - nextcloud-server.git/commitdiff
Check address book URI length before creation 33782/head
authorJoas Schilling <coding@schilljs.com>
Fri, 26 Aug 2022 11:58:18 +0000 (13:58 +0200)
committerbackportbot-nextcloud[bot] <backportbot-nextcloud[bot]@users.noreply.github.com>
Thu, 1 Sep 2022 05:34:42 +0000 (05:34 +0000)
Signed-off-by: Joas Schilling <coding@schilljs.com>
apps/dav/lib/CardDAV/CardDavBackend.php

index 1c1754ff752f35c50f640a46119e1025fd3727d0..ebbf44376f57f7faa0a03c7922695bc1ace07614 100644 (file)
@@ -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,