Commit 6117ff7
authored
fix(vulnfeeds): prevent duplicate events in database_specific (google#5593)
`combine-to-osv` merges database_specific fields using
`MergeDatabaseSpecificValues` from the `conversion` package. However,
the helper function `deduplicateList` only checked comparable basic
types (strings, ints, floats, bools). Non-comparable types (like maps
representing JSON objects) were always appended without deduplication.
I updated `deduplicateList` to check if a type is comparable. If it's
not (e.g. a map or slice), it now checks for uniqueness against
previously observed uncomparable elements using `reflect.DeepEqual`.1 parent f2df998 commit 6117ff7
2 files changed
Lines changed: 41 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
434 | 434 | | |
435 | 435 | | |
436 | 436 | | |
437 | | - | |
| 437 | + | |
438 | 438 | | |
439 | 439 | | |
440 | | - | |
| 440 | + | |
| 441 | + | |
441 | 442 | | |
442 | | - | |
443 | | - | |
444 | | - | |
445 | | - | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
446 | 467 | | |
447 | 468 | | |
448 | | - | |
449 | | - | |
450 | 469 | | |
451 | 470 | | |
452 | 471 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
307 | 307 | | |
308 | 308 | | |
309 | 309 | | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
310 | 324 | | |
311 | 325 | | |
312 | 326 | | |
| |||
0 commit comments