From 1629228b7b7c77dcbdedbd5acb403e6ea0492247 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Wed, 24 Feb 2016 11:20:39 +0100 Subject: cid#1326391: Dereference null return value ...replacing implicit NullPointerException with explicit IOException Change-Id: I673c836c64e141a7a3e4b40fca0922feee26bd03 --- jurt/com/sun/star/lib/uno/protocols/urp/urp.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'jurt/com') diff --git a/jurt/com/sun/star/lib/uno/protocols/urp/urp.java b/jurt/com/sun/star/lib/uno/protocols/urp/urp.java index 5e7b3288866c..3033481d17b1 100644 --- a/jurt/com/sun/star/lib/uno/protocols/urp/urp.java +++ b/jurt/com/sun/star/lib/uno/protocols/urp/urp.java @@ -398,14 +398,16 @@ public final class urp implements IProtocol { return readRequest(funId, sync); } - private UrpMessage readShortRequest(int header) { + private UrpMessage readShortRequest(int header) throws IOException { int funId = (header & HEADER_FUNCTIONID14) != 0 ? ((header & HEADER_FUNCTIONID) << 8) | unmarshal.read8Bit() : header & HEADER_FUNCTIONID; return readRequest(funId, false); } - private UrpMessage readRequest(int functionId, boolean forcedSynchronous) { + private UrpMessage readRequest(int functionId, boolean forcedSynchronous) + throws IOException + { boolean internal = PROPERTIES_OID.equals(inL1Oid); // inL1Oid may be null in XInstanceProvider.getInstance("") XCurrentContext cc = @@ -415,6 +417,10 @@ public final class urp implements IProtocol { new Type(XCurrentContext.class)) : null; IMethodDescription desc = inL1Type.getMethodDescription(functionId); + if (desc == null) { + throw new IOException( + "read URP request with unsupported function ID " + functionId); + } ITypeDescription[] inSig = desc.getInSignature(); ITypeDescription[] outSig = desc.getOutSignature(); Object[] args = new Object[inSig.length]; -- cgit