V6060. The reference was used before it was verified against null.
V6060 [CWE-476] The 'params' reference was utilized before it was verified against null. Check lines: 27, 25. XMSSMTPrivateKeyParameters.java 27
private XMSSMTPrivateKeyParameters(Builder builder)
{
super(true, builder.params.getDigest().getAlgorithmName());
params = builder.params;
if (params == null)
{
throw new NullPointerException("params == null");
}
....
}
Similar errors can be found in some other places:
V6060 The 'node' reference was utilized before it was verified against null. RestTasksAction.java(152), RestTasksAction.java(151)
private void buildRow(Table table, boolean fullId,
boolean detailed, DiscoveryNodes discoveryNodes,
TaskInfo taskInfo) {
....
DiscoveryNode node = discoveryNodes.get(nodeId);
....
// Node information. Note that the node may be null because it has
// left the cluster between when we got this response and now.
table.addCell(fullId ? nodeId : Strings.substring(nodeId, 0, 4));
table.addCell(node == null ? "-" : node.getHostAddress());
table.addCell(node.getAddress().address().getPort());
table.addCell(node == null ? "-" : node.getName());
table.addCell(node == null ? "-" : node.getVersion().toString());
....
}
V6060 The 'cause' reference was utilized before it was verified against null. StartupException.java(76), StartupException.java(73)
private void printStackTrace(Consumer<String> consumer) {
Throwable originalCause = getCause();
Throwable cause = originalCause;
if (cause instanceof CreationException) {
cause = getFirstGuiceCause((CreationException)cause);
}
String message = cause.toString(); // <=
consumer.accept(message);
if (cause != null) { // <=
// walk to the root cause
while (cause.getCause() != null) {
cause = cause.getCause();
}
....
}
....
}
V6060 The 'descriptionPopup' reference was utilized before it was verified against null. SuggestPopup.java(252), SuggestPopup.java(251)
protected void updateDescriptionPopupPosition() {
int x = getAbsoluteLeft() + WIDTH;
int y = getAbsoluteTop();
descriptionPopup.setPopupPosition(x, y);
if (descriptionPopup!=null) {
descriptionPopup.setPopupPosition(x, y);
}
}
V6060 The 'tableModel' reference was utilized before it was verified against null. DesktopAbstractTable.java(1580), DesktopAbstractTable.java(1564)
protected Column addRuntimeGeneratedColumn(String columnId) {
// store old cell editors / renderers
TableCellEditor[] cellEditors =
new TableCellEditor[tableModel.getColumnCount() + 1]; // <=
TableCellRenderer[] cellRenderers =
new TableCellRenderer[tableModel.getColumnCount() + 1]; // <=
for (int i = 0; i < tableModel.getColumnCount(); i++) { // <=
Column tableModelColumn = tableModel.getColumn(i);
if (tableModel.isGeneratedColumn(tableModelColumn)) { // <=
TableColumn tableColumn = getColumn(tableModelColumn);
cellEditors[i] = tableColumn.getCellEditor();
cellRenderers[i] = tableColumn.getCellRenderer();
}
}
Column col = new Column(columnId, columnId);
col.setEditable(false);
columns.put(col.getId(), col);
if (tableModel != null) { // <=
tableModel.addColumn(col);
}
....
}
Similar errors can be found in some other places:
V6060 The 'params' reference was utilized before it was verified against null. DomainService.java(49), DomainService.java(46)
public Domains list(Map<String, String> params)
{
Preconditions.checkNotNull(params.get("page_size"), ....);
Preconditions.checkNotNull(params.get("page_number"), ....);
Invocation<Domains> domainInvocation = get(Domains.class, uri("/domains"));
if (params != null) { // <=
....
}
return domainInvocation.execute(this.buildExecutionOptions(Domains.class));
}
Similar errors can be found in some other places:
V6060 The 'player' reference was utilized before it was verified against null. VigeanIntuition.java(79), VigeanIntuition.java(78)
@Override
public boolean apply(Game game, Ability source) {
MageObject sourceObject = game.getObject(source.getSourceId());
Player player = game.getPlayer(source.getControllerId());
Library library = player.getLibrary(); // <=
if (player != null && sourceObject != null && library != null) { // <=
....
}
}
V6060 The 'dataSourceController' reference was utilized before it was verified against null. AbstractDataSourceAdd.java(399), AbstractDataSourceAdd.java(297)
void StepsecondRuntimeStep(....) throws OperationFailedException {
....
dataSourceController.getService() ....
....
if (dataSourceController != null) {....}
....
}
V6060 The 'params' reference was utilized before it was verified against null. BCDSAPublicKey.java(54), BCDSAPublicKey.java(53)
BCDSAPublicKey(DSAPublicKeyParameters params) {
this.y = params.getY();
if (params != null) {
this.dsaSpec = new DSAParameterSpec(params.getParameters().getP(),
params.getParameters().getQ(),
params.getParameters().getG());
} else {
this.dsaSpec = null;
}
this.lwKeyParams = params;
}
This is exactly the case when a reply to a comment turned into a small blog post. The power of ...