Skip to content
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

Prevent null pointer exception in Sonarqube #334

Merged
merged 4 commits into from
Jul 9, 2019

Conversation

gcmurphy
Copy link
Member

@gcmurphy gcmurphy commented Jul 4, 2019

The json encoding of uninitialized arrays is null. This causes a NPE in sonarqube tool. We should return an empty array rather than a null value here.

Example of this behaviour is: https://play.golang.org/p/UUvP9JwsYlm

Relates to: #333

the json encoding of uninitialized arrays is null. this causes a npe in
sonarqube tool. we should return an empty array rather than a null value
here.

relates to: securego#333
@gcmurphy gcmurphy requested a review from ccojocar July 4, 2019 22:25
@codecov-io
Copy link

Codecov Report

Merging #334 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #334   +/-   ##
=======================================
  Coverage   65.72%   65.72%           
=======================================
  Files           9        9           
  Lines         566      566           
=======================================
  Hits          372      372           
  Misses        174      174           
  Partials       20       20

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 39f7e7b...cc32825. Read the comment docs.

@gcmurphy gcmurphy merged commit 4b59c94 into securego:master Jul 9, 2019
MVrachev pushed a commit to MVrachev/gosec that referenced this pull request Jul 31, 2019
* fix(formatters) null value causes npe in sonarqube

the json encoding of uninitialized arrays is null. this causes a npe in
sonarqube tool. we should return an empty array rather than a null value
here.

relates to: securego#333
MVrachev pushed a commit to MVrachev/gosec that referenced this pull request Jul 31, 2019
* fix(formatters) null value causes npe in sonarqube

the json encoding of uninitialized arrays is null. this causes a npe in
sonarqube tool. we should return an empty array rather than a null value
here.

relates to: securego#333
MVrachev pushed a commit to MVrachev/gosec that referenced this pull request Jul 31, 2019
* fix(formatters) null value causes npe in sonarqube

the json encoding of uninitialized arrays is null. this causes a npe in
sonarqube tool. we should return an empty array rather than a null value
here.

relates to: securego#333
MVrachev pushed a commit to MVrachev/gosec that referenced this pull request Jul 31, 2019
* fix(formatters) null value causes npe in sonarqube

the json encoding of uninitialized arrays is null. this causes a npe in
sonarqube tool. we should return an empty array rather than a null value
here.

relates to: securego#333
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants