Skip to content

Commit

Permalink
[FIXED JENKINS-9412] Fixed possible NPE in
Browse files Browse the repository at this point in the history
GlobalMatrixAuthorizationStrategy$DescriptorImpl.doCheckName
  • Loading branch information
kohsuke committed May 11, 2011
1 parent 74e35d8 commit c595586
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions changelog.html
Expand Up @@ -55,6 +55,9 @@
<!-- Record your changes in the trunk here. -->
<div id="trunk" style="display:none"><!--=TRUNK-BEGIN=-->
<ul class=image>
<li class=bug>
Fixed NPE in <tt>GlobalMatrixAuthorizationStrategy.doCheckName</tt>
(<a href="http://issues.jenkins-ci.org/browse/JENKINS-9412">issue 9412</a>)
<li class=bug>
Fixed a <tt>ClassCastException</tt> caused by multiple loading of the same class in different classloaders.
(<a href="http://issues.jenkins-ci.org/browse/JENKINS-9017">issue 9017</a>)
Expand Down
Expand Up @@ -178,7 +178,7 @@ public boolean showPermission(Permission p) {
}

public FormValidation doCheckName(@AncestorInPath Job project, @QueryParameter String value) throws IOException, ServletException {
return GlobalMatrixAuthorizationStrategy.DESCRIPTOR.doCheckName(value, project, AbstractProject.CONFIGURE);
return GlobalMatrixAuthorizationStrategy.DESCRIPTOR.doCheckName_(value, project, AbstractProject.CONFIGURE);
}
}

Expand Down
Expand Up @@ -284,10 +284,10 @@ public boolean showPermission(Permission p) {
}

public FormValidation doCheckName(@QueryParameter String value ) throws IOException, ServletException {
return doCheckName(value, Hudson.getInstance(), Hudson.ADMINISTER);
return doCheckName_(value, Hudson.getInstance(), Hudson.ADMINISTER);
}

public FormValidation doCheckName(String value, AccessControlled subject, Permission permission) throws IOException, ServletException {
public FormValidation doCheckName_(String value, AccessControlled subject, Permission permission) throws IOException, ServletException {
if(!subject.hasPermission(permission)) return FormValidation.ok(); // can't check

final String v = value.substring(1,value.length()-1);
Expand Down

0 comments on commit c595586

Please sign in to comment.