pixeebot[bot]
|
3afacf2405
|
Switch order of literals to prevent NullPointerException (#2769)
This change defensively switches the order of literals in comparison
expressions to ensure that no null pointer exceptions are unexpectedly
thrown. Runtime exceptions especially can cause exceptional and
unexpected code paths to be taken, and this can result in unexpected
behavior.
Both simple vulnerabilities (like information disclosure) and complex
vulnerabilities (like business logic flaws) can take advantage of these
unexpected code paths.
Our changes look something like this:
```diff
String fieldName = header.getFieldName();
String fieldValue = header.getFieldValue();
- if(fieldName.equals("requestId")) {
+ if("requestId".equals(fieldName)) {
logRequest(fieldValue);
}
```
<details>
<summary>More reading</summary>
*
[https://cwe.mitre.org/data/definitions/476.html](https://cwe.mitre.org/data/definitions/476.html)
*
[https://en.wikibooks.org/wiki/Java_Programming/Preventing_NullPointerException](https://en.wikibooks.org/wiki/Java_Programming/Preventing_NullPointerException)
*
[https://rules.sonarsource.com/java/RSPEC-1132/](https://rules.sonarsource.com/java/RSPEC-1132/)
</details>
🧚🤖 Powered by Pixeebot
[Feedback](https://ask.pixee.ai/feedback) |
[Community](https://pixee-community.slack.com/signup#/domain-signup) |
[Docs](https://docs.pixee.ai/) | Codemod ID:
pixee:java/switch-literal-first

<!--{"type":"DRIP","codemod":"pixee:java/switch-literal-first"}-->
Co-authored-by: pixeebot[bot] <104101892+pixeebot[bot]@users.noreply.github.com>
|
2025-01-22 10:39:47 +00:00 |
|
Anthony Stirling
|
99d1b46d97
|
Update MetricsAggregatorService.java
|
2024-12-03 15:26:40 +00:00 |
|
Anthony Stirling
|
212e521238
|
Update MetricsAggregatorService.java
|
2024-11-26 21:30:47 +00:00 |
|
Anthony Stirling
|
833b3c45c6
|
Removal of Ghostscript to use qpdf and tesseract directly (#2338)
* navbar fix multi tool and compress location
* release notes and ghostscript removal
* cleanups
* formatting
* update docs
* more
* more
* docs
* release bump
* Hardening suggestions for Stirling-PDF / ghostscript (#2339)
* Protect `readLine()` against DoS
* Sanitized user-provided file names in HTTP multipart uploads
---------
Co-authored-by: pixeebot[bot] <104101892+pixeebot[bot]@users.noreply.github.com>
---------
Co-authored-by: pixeebot[bot] <104101892+pixeebot[bot]@users.noreply.github.com>
|
2024-11-26 20:50:35 +00:00 |
|
Anthony Stirling
|
5936e856f0
|
metrics
|
2024-11-25 14:02:17 +00:00 |
|
Anthony Stirling
|
6c623d8d84
|
Update MetricsAggregatorService.java (#2272)
|
2024-11-20 08:20:01 +00:00 |
|
Anthony Stirling
|
c85463bc18
|
Frooodle/license (#1994)
|
2024-10-14 22:34:41 +01:00 |
|