Commit 863b820
committed
Added whitespace sanitization in fuzzySearch CPE
The vendor and product String parameters passed to fuzzySearch() might
contain spaces, as the frontend does not prevent inputting these when
manually creating a component. As far as I know CycloneDX and SPDX
also do not restrict this, so imported components could also contain
spaces in their name and vendor properties.
As fuzzySearch() creates a new CPE object which is validated inside the
constructor, this will cause exceptions to be logged for all components
that contain spaces.
I have added a simple replace before passing these strings to the CPE
constructor to prevent the exceptions from being thrown.
Signed-off-by: jonbally <[email protected]>1 parent 0b9c45f commit 863b820
File tree
1 file changed
+6
-4
lines changed- src/main/java/org/dependencytrack/search
1 file changed
+6
-4
lines changedLines changed: 6 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
153 | | - | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
154 | 156 | | |
155 | 157 | | |
156 | 158 | | |
| |||
239 | 241 | | |
240 | 242 | | |
241 | 243 | | |
242 | | - | |
243 | | - | |
| 244 | + | |
| 245 | + | |
244 | 246 | | |
245 | 247 | | |
246 | 248 | | |
| |||
266 | 268 | | |
267 | 269 | | |
268 | 270 | | |
269 | | - | |
| 271 | + | |
270 | 272 | | |
271 | 273 | | |
272 | 274 | | |
| |||
0 commit comments