Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrelves2007-06-25 22:27:32 -0400
committerrelves2007-06-25 22:27:32 -0400
commit190c217935892319f595ce3b13cc5626f89123dd (patch)
treed8509f0e5b7c14d417d01cd33594453e9d51c2f6
parente780209406955493e7c27c95005dae961e504901 (diff)
downloadorg.eclipse.mylyn.tasks-190c217935892319f595ce3b13cc5626f89123dd.tar.gz
org.eclipse.mylyn.tasks-190c217935892319f595ce3b13cc5626f89123dd.tar.xz
org.eclipse.mylyn.tasks-190c217935892319f595ce3b13cc5626f89123dd.zip
REOPENED - bug 194106: Bugzilla TaskDataHandler does not validate id
https://bugs.eclipse.org/bugs/show_bug.cgi?id=194106
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaRepositoryConnector.java9
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaTaskDataHandler.java2
2 files changed, 10 insertions, 1 deletions
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaRepositoryConnector.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaRepositoryConnector.java
index c02271f0f..c14495d6c 100644
--- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaRepositoryConnector.java
+++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaRepositoryConnector.java
@@ -633,4 +633,13 @@ public class BugzillaRepositoryConnector extends AbstractRepositoryConnector {
// newReport.attributes = attributes;
}
+ public static int getBugId(String taskId) throws CoreException {
+ try {
+ return Integer.parseInt(taskId);
+ } catch (NumberFormatException e) {
+ throw new CoreException(new Status(IStatus.ERROR, BugzillaCorePlugin.PLUGIN_ID, 0,
+ "Invalid bug id: " + taskId, e));
+ }
+ }
+
}
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaTaskDataHandler.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaTaskDataHandler.java
index 6add39a36..f7c3822cd 100644
--- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaTaskDataHandler.java
+++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaTaskDataHandler.java
@@ -69,7 +69,7 @@ public class BugzillaTaskDataHandler extends AbstractTaskDataHandler {
throws CoreException {
try {
BugzillaClient client = connector.getClientManager().getClient(repository);
- int bugId = Integer.parseInt(taskId);
+ int bugId = BugzillaRepositoryConnector.getBugId(taskId);
RepositoryTaskData taskData;
try {
taskData = client.getTaskData(bugId);

Back to the top