[Libreoffice-commits] core.git: xmerge/source
Caolán McNamara
caolanm at redhat.com
Tue Mar 1 10:23:16 UTC 2016
xmerge/source/xmerge/java/org/openoffice/xmerge/util/registry/ConverterInfoMgr.java | 18 +++++++---
1 file changed, 13 insertions(+), 5 deletions(-)
New commits:
commit d112040b7f91415a4f58b9e1a7bd84bd5c914c81
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Mar 1 10:22:08 2016 +0000
coverity#1326444 Dereference null return value
Change-Id: I0163b298a3c3359b0f035515408f2a81ef405377
diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/util/registry/ConverterInfoMgr.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/util/registry/ConverterInfoMgr.java
index 019beaf..9cea2df 100644
--- a/xmerge/source/xmerge/java/org/openoffice/xmerge/util/registry/ConverterInfoMgr.java
+++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/util/registry/ConverterInfoMgr.java
@@ -262,6 +262,14 @@ public final class ConverterInfoMgr {
return null;
}
+ static String readLine(BufferedReader br) throws IOException{
+ String ret = br.readLine();
+ if (ret == null) {
+ throw new IOException("short read");
+ }
+ return ret;
+ }
+
/**
* Main to let the user specify what plug-ins to register from jarfiles and
* to display the currently registered plug-ins.
@@ -290,7 +298,7 @@ public final class ConverterInfoMgr {
System.out.println("(Q)uit\n");
try {
- c = br.readLine().toUpperCase().trim().charAt(0);
+ c = readLine(br).toUpperCase().trim().charAt(0);
} catch(Exception e) {
System.out.println("Invalid entry");
System.out.println("Error msg: " + e.getMessage());
@@ -308,7 +316,7 @@ public final class ConverterInfoMgr {
System.out.println("Enter path to jarfile: ");
try {
- String jarname = br.readLine().trim();
+ String jarname = readLine(br).trim();
cir = new ConverterInfoReader(jarname,validate);
} catch (RegistryException e) {
System.out.println("Cannot load plug-in ConverterFactory implementation.");
@@ -346,7 +354,7 @@ public final class ConverterInfoMgr {
}
try {
- String name = br.readLine().trim();
+ String name = readLine(br).trim();
boolean rc = false;
if (c == 'D') {
@@ -380,7 +388,7 @@ public final class ConverterInfoMgr {
}
try {
- findMimeOne = br.readLine().trim();
+ findMimeOne = readLine(br).trim();
} catch (Exception e) {
System.out.println("Error adding data to registry");
System.out.println("Error msg: " + e.getMessage());
@@ -393,7 +401,7 @@ public final class ConverterInfoMgr {
}
try {
- findMimeTwo = br.readLine().trim();
+ findMimeTwo = readLine(br).trim();
} catch (Exception e) {
System.out.println("Error adding data to registry");
System.out.println("Error msg: " + e.getMessage());
More information about the Libreoffice-commits
mailing list