Commit bc76b3f
committed
Improve __unserialize() hardening for SplHeap/SplPriorityQueue
It was possible to make the heap accept unserialize data when the heap
was corrupted or under modification. This adds the necessary check to
prevent that from happening.
Also, the exception check at the bottom is pointless,
spl_heap_unserialize_internal_state() already returns FAILURE on
exception. If it *is* necessary, it should be documented why.
Closes GH-20109.1 parent 234577e commit bc76b3f
File tree
3 files changed
+35
-4
lines changed- ext/spl
- tests
3 files changed
+35
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1257 | 1257 | | |
1258 | 1258 | | |
1259 | 1259 | | |
| 1260 | + | |
| 1261 | + | |
| 1262 | + | |
| 1263 | + | |
1260 | 1264 | | |
1261 | 1265 | | |
1262 | 1266 | | |
| |||
1285 | 1289 | | |
1286 | 1290 | | |
1287 | 1291 | | |
1288 | | - | |
1289 | | - | |
1290 | | - | |
1291 | | - | |
1292 | 1292 | | |
1293 | 1293 | | |
1294 | 1294 | | |
| |||
Lines changed: 30 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
0 commit comments