Commit f6f61c3
committed
buffer: prevent string write offset overflow
Reject offsets outside the destination buffer before subtracting from
its length in SlowWriteString. Normalize wrapper arguments once so
validated values reach the native binding.
Signed-off-by: Matteo Collina <hello@matteocollina.com>1 parent f43086d commit f6f61c3
3 files changed
Lines changed: 31 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
959 | 959 | | |
960 | 960 | | |
961 | 961 | | |
962 | | - | |
| 962 | + | |
| 963 | + | |
963 | 964 | | |
964 | 965 | | |
965 | 966 | | |
| 967 | + | |
| 968 | + | |
966 | 969 | | |
967 | 970 | | |
968 | 971 | | |
969 | 972 | | |
970 | 973 | | |
971 | 974 | | |
972 | | - | |
| 975 | + | |
| 976 | + | |
973 | 977 | | |
974 | 978 | | |
975 | 979 | | |
| 980 | + | |
| 981 | + | |
976 | 982 | | |
977 | 983 | | |
978 | 984 | | |
979 | 985 | | |
980 | 986 | | |
981 | 987 | | |
982 | | - | |
| 988 | + | |
| 989 | + | |
983 | 990 | | |
984 | 991 | | |
985 | 992 | | |
| 993 | + | |
| 994 | + | |
986 | 995 | | |
987 | 996 | | |
988 | 997 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1727 | 1727 | | |
1728 | 1728 | | |
1729 | 1729 | | |
| 1730 | + | |
| 1731 | + | |
| 1732 | + | |
| 1733 | + | |
| 1734 | + | |
1730 | 1735 | | |
1731 | 1736 | | |
1732 | 1737 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
0 commit comments