From dfe19864de718b188cd64fe95479798208a76b04 Mon Sep 17 00:00:00 2001 From: Esteban Dugueperoux Date: Thu, 21 Nov 2013 12:32:50 +0100 Subject: [422170] [Security] NPE on Permissions update for detached objects https://bugs.eclipse.org/bugs/show_bug.cgi?id=422170 have LoadPermissionsRequest and LoadPermissionsIndication manage case of detached objects to avoid a NPE Change-Id: I149ce4413d35c93017624f1744e31e23e44f6a09 --- .../server/internal/net4j/protocol/LoadPermissionsIndication.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf') diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LoadPermissionsIndication.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LoadPermissionsIndication.java index 9235fd146e..8ef6881adc 100644 --- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LoadPermissionsIndication.java +++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LoadPermissionsIndication.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * Caspar De Groot - initial API and implementation */ @@ -73,6 +73,10 @@ public class LoadPermissionsIndication extends CDOServerReadIndication CDOPermission oldPermission = oldPermissions[i]; InternalCDORevision revision = revisionManager.getRevision(id, head, 0, CDORevision.DEPTH_NONE, true); + if (revision == null) + { + out.writeByte(CDOProtocolConstants.REVISION_DOES_NOT_EXIST); + } CDOPermission newPermission = permissionManager.getPermission(revision, head, session); out.writeByte(newPermission.getBits()); -- cgit v1.2.3