Commit c7a86a3
committed
Fix pgsql use after free trying to reuse closed connection
When a connection is closed, we also need to remove the hash entry
from the regular_list, as it now points to freed memory. To do this
store a reverse mapping from the connection to the hash string.
It would be nicer to introduce a wrapping structure for the pgsql
link resource that could store the hash (and notices), but that would
require large changes to the extension, so I'm going for a more
minimal fix here.1 parent b55715d commit c7a86a3
File tree
4 files changed
+47
-9
lines changed- Zend
- ext/pgsql
- tests
4 files changed
+47
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
| 64 | + | |
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
939 | 939 | | |
940 | 940 | | |
941 | 941 | | |
| 942 | + | |
942 | 943 | | |
943 | 944 | | |
944 | 945 | | |
945 | 946 | | |
946 | 947 | | |
947 | 948 | | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
948 | 956 | | |
949 | 957 | | |
950 | 958 | | |
| |||
1099 | 1107 | | |
1100 | 1108 | | |
1101 | 1109 | | |
| 1110 | + | |
1102 | 1111 | | |
1103 | 1112 | | |
1104 | 1113 | | |
| |||
1215 | 1224 | | |
1216 | 1225 | | |
1217 | 1226 | | |
| 1227 | + | |
1218 | 1228 | | |
1219 | 1229 | | |
1220 | 1230 | | |
| |||
1236 | 1246 | | |
1237 | 1247 | | |
1238 | 1248 | | |
| 1249 | + | |
1239 | 1250 | | |
1240 | 1251 | | |
1241 | 1252 | | |
| |||
1431 | 1442 | | |
1432 | 1443 | | |
1433 | 1444 | | |
1434 | | - | |
1435 | | - | |
1436 | | - | |
1437 | | - | |
1438 | | - | |
1439 | | - | |
1440 | | - | |
1441 | | - | |
| 1445 | + | |
| 1446 | + | |
| 1447 | + | |
| 1448 | + | |
| 1449 | + | |
1442 | 1450 | | |
1443 | 1451 | | |
1444 | 1452 | | |
| |||
1484 | 1492 | | |
1485 | 1493 | | |
1486 | 1494 | | |
| 1495 | + | |
| 1496 | + | |
| 1497 | + | |
| 1498 | + | |
| 1499 | + | |
| 1500 | + | |
| 1501 | + | |
| 1502 | + | |
| 1503 | + | |
| 1504 | + | |
1487 | 1505 | | |
1488 | 1506 | | |
1489 | 1507 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
319 | 319 | | |
320 | 320 | | |
321 | 321 | | |
| 322 | + | |
322 | 323 | | |
323 | 324 | | |
324 | 325 | | |
| |||
| 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 | + | |
0 commit comments