Commit e677617
Add NULL checks for atexit import during CinderX module init
Summary:
PyImport_ImportModule("atexit") and the subsequent
PyObject_GetAttrString were used without NULL checks. If either
failed, the next call would receive a nullptr argument, causing
undefined behavior. Add early-return error checks consistent with
the existing pattern used for other imports in the same function.
Reviewed By: yoney
Differential Revision: D94680101
fbshipit-source-id: a9f0444f0bd06286b68b74d25f1037861d8d7e151 parent eb31409 commit e677617
1 file changed
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1425 | 1425 | | |
1426 | 1426 | | |
1427 | 1427 | | |
| 1428 | + | |
| 1429 | + | |
| 1430 | + | |
1428 | 1431 | | |
| 1432 | + | |
| 1433 | + | |
| 1434 | + | |
1429 | 1435 | | |
1430 | 1436 | | |
1431 | 1437 | | |
| |||
0 commit comments