Commit e9f706b
committed
gh-152959: Raise ValueError for a <key> outside a <dict> in plistlib
_PlistParser.end_key evaluated self.stack[-1] before checking whether the
stack was empty, so a <key> element outside a <dict> (for example at the
document root) leaked an IndexError instead of a ValueError. Guard the
empty-stack case, matching the sibling add_object handler. The binary plist
format does not use this path and is unaffected.1 parent 0a13efc commit e9f706b
3 files changed
Lines changed: 10 additions & 1 deletion
File tree
- Lib
- test
- Misc/NEWS.d/next/Library
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
243 | 243 | | |
244 | 244 | | |
245 | 245 | | |
246 | | - | |
| 246 | + | |
| 247 | + | |
247 | 248 | | |
248 | 249 | | |
249 | 250 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
876 | 876 | | |
877 | 877 | | |
878 | 878 | | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
879 | 885 | | |
880 | 886 | | |
881 | 887 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
0 commit comments