You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The method calculateItem returns null when the parameter obj is null.
However, after checking several call sites of this method, we found that most of them don't handle the null case. For example, Number rval = (Number) calculateItem(this.right); in the method calculate assigns the return value of to variable rval. Then, the variable is used without checking whether it is null. Only two implementations of calculate in class AndOpt and OrOpt check whether the return value of calculateItem is null or not.
visitJumpInsn invokes currentBlock.frame.execute(opcode, 0, null, null); at line 1021. The third argument is used in push(cw, item.strVal1); at method execute. Then, the null value may be dereferenced in the method push
2.1. Similar to the second one, visitVarInsn also invokes currentBlock.frame.execute(opcode, var, null, null); at line 795.
2.2. Similarily, visitIntInsn invokes currentBlock.frame.execute(opcode, operand, null, null); at line 770.
2.3. The remaining potential NPE bugs with this pattern includes: 1011, 368
The method readUTF8 may return null at line 2452. Then the return value is used by https://github.com/nutzam/nutz/tree/v1.r.68.v20191031/src/org/nutz/repo/org/objectweb/asm/ClassReader.java at line 2557. Then it calls method getObjectType and uses the parameter in char[] buf = internalName.toCharArray(); at line 228
The second argument of mv.visitTypeInsn(CHECKCAST, type.getClassName().replace('.', '/')); at line 109 may return null due to the line 576
Thanks
The text was updated successfully, but these errors were encountered:
Hi, we have reported the bugs a while ago would you please take a look and confirm if they are real bugs. We have been conducting an experiment to measure the accuracy of our static checker. We would be deeply appreciated if you can provide some feedback!
Hi all,
Our tool has found several potential NPE bugs.
The method
calculateItem
returns null when the parameterobj
is null.However, after checking several call sites of this method, we found that most of them don't handle the null case. For example,
Number rval = (Number) calculateItem(this.right);
in the methodcalculate
assigns the return value of to variablerval
. Then, the variable is used without checking whether it is null. Only two implementations ofcalculate
in classAndOpt
andOrOpt
check whether the return value ofcalculateItem
is null or not.visitJumpInsn
invokescurrentBlock.frame.execute(opcode, 0, null, null);
at line 1021. The third argument is used inpush(cw, item.strVal1);
at method execute. Then, the null value may be dereferenced in the methodpush
2.1. Similar to the second one,
visitVarInsn
also invokescurrentBlock.frame.execute(opcode, var, null, null);
at line 795.2.2. Similarily,
visitIntInsn
invokescurrentBlock.frame.execute(opcode, operand, null, null);
at line 770.2.3. The remaining potential NPE bugs with this pattern includes: 1011, 368
The method
readUTF8
may return null at line 2452. Then the return value is used byhttps://github.com/nutzam/nutz/tree/v1.r.68.v20191031/src/org/nutz/repo/org/objectweb/asm/ClassReader.java
at line 2557. Then it calls methodgetObjectType
and uses the parameter inchar[] buf = internalName.toCharArray();
at line 228The second argument of
mv.visitTypeInsn(CHECKCAST, type.getClassName().replace('.', '/'));
at line 109 may return null due to the line 576Thanks
The text was updated successfully, but these errors were encountered: