Commit 98347d2
* The Delete function now catches out of bound index and does not throw a segmentation fault.
### Rationale for this change
The `KeyValueMetadata::Delete(int64_t index)` never checked for out of bounds value of `index`, & if `index` was out of bounds, then a seg fault was thrown by the program and it aborted.
### What changes are included in this PR?
The `KeyValueMetadata::Delete(int64_t index)` now returns a IndexError for out of bounds values of `index`
### Are these changes tested?
Yes, CI tests pass on my fork
### Are there any user-facing changes?
No API changes
* GitHub Issue: #50311
Lead-authored-by: OmBiradar <ombiradar04@gmail.com>
Co-authored-by: Om Biradar <ombiradar04@gmail.com>
Co-authored-by: Antoine Pitrou <pitrou@free.fr>
Signed-off-by: Antoine Pitrou <antoine@python.org>
1 parent 0f6dd60 commit 98347d2
2 files changed
Lines changed: 26 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
103 | 109 | | |
104 | 110 | | |
105 | 111 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
187 | 187 | | |
188 | 188 | | |
189 | 189 | | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
190 | 210 | | |
191 | 211 | | |
192 | 212 | | |
| |||
0 commit comments