-
Notifications
You must be signed in to change notification settings - Fork 8.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Some potential NPE bugs #1403
Comments
@sczyh30 Thanks for your feedback. We are trying to get some results of our dogfooding. Could you please confirm which ones are indeed bugs? Thanks a million! |
1.The first one is at FileInJarReadableDataSource.java#L99 since the variable inputStream may be null.
2.The second one is at SimpleHttpClient.java#L168 cause the variable charset may be null. Since the variable charset is checked for null at SimpleHttpClient.java#L100, a NPE bug may take place when the call chain is SimpleHttpClient.java#L111 => SimpleHttpClient.java#L168.
|
3.The third one is at EagleEye.java#L101 since the variable tmpPath may be null. A possible call chain is getSystemProperty() => EagleEye.java#L99 => EagleEye.java#L101.The same bug may take place at EagleEye.java#L113. Some familiar situationa are at EagleEye.java#L64 since the variable charsetName may be null, EagleEye.java#L89 since the variable userHome may be null.
|
4.The forth is at StatisticSlot.java#L147. A possible call chain is getCurNode() =>StatisticSlot.java#L136 =>StatisticSlot.java#L147. Since the method getCurNode() may return null, the variable node at StatisticSlot.java#L147 may be null and thus a NPE bug may take place.
5.The fifth is at SimpleHttpResponse.java#L50. A possible call chain is getHeader() =>SimpleHttpResponse.java#L49 =>SimpleHttpResponse.java#L50.Since the method
|
@sczyh30 这个后续的改动您看看,是否有必要合并 |
[ISSUE alibaba#1400]do disk space detection in another thread
Hi all, our bug scanner has reported some NPE bugs.
1.The first one is at FileInJarReadableDataSource.java#L99 since the variable
inputStream
may benull
.2.The second one is at SimpleHttpClient.java#L168 cause the variable
charset
may benull
. Since the variablecharset
is checked fornull
at SimpleHttpClient.java#L100, a NPE bug may take place when the call chain is SimpleHttpClient.java#L111 => SimpleHttpClient.java#L168.3.The third one is at EagleEye.java#L101 since the variable
tmpPath
may benull
. A possible call chain is getSystemProperty() => EagleEye.java#L99 => EagleEye.java#L101.The same bug may take place at EagleEye.java#L113. Some familiar situationa are at EagleEye.java#L64 since the variablecharsetName
may benull
, EagleEye.java#L89 since the variableuserHome
may benull
.4.The forth is at StatisticSlot.java#L147. A possible call chain is getCurNode() =>StatisticSlot.java#L136 =>StatisticSlot.java#L147. Since the method
getCurNode()
may returnnull
, the variablenode
at StatisticSlot.java#L147 may benull
and thus a NPE bug may take place.5.The fifth is at SimpleHttpResponse.java#L50. A possible call chain is getHeader() =>SimpleHttpResponse.java#L49 =>SimpleHttpResponse.java#L50.Since the method
getHeader()
may returnnull
, the variablecontentType
at SimpleHttpResponse.java#L50 may benull
and thus a NPE bug may take place.Thanks.
The text was updated successfully, but these errors were encountered: