Commit a746312
committed
ICU-23251 Validate serialized spoof data offsets in SpoofData::initPtrs()
Add bounds checking for all offset+size pairs (fCFUKeys, fCFUStringIndex,
fCFUStringTable) against the total data length in SpoofData::initPtrs().
Also validate consistency: if confusable keys exist (fCFUKeysSize > 0),
the string index and string table must also be present.
Without this validation, crafted serialized data passed to
uspoof_openFromSerialized() can produce a SpoofChecker with NULL internal
pointers, causing a NULL pointer dereference when uspoof_check() is
subsequently called.1 parent 9b16ae8 commit a746312
1 file changed
Lines changed: 34 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
687 | 687 | | |
688 | 688 | | |
689 | 689 | | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
690 | 724 | | |
691 | 725 | | |
692 | 726 | | |
| |||
0 commit comments