-
-
Notifications
You must be signed in to change notification settings - Fork 33.2k
gh-106287: do not write objects after an unmarshalling error #132715
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 2 commits
407a473
b77cd2d
dc52961
f410a39
329c6e2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Skip writing objects during marshalling once a failure has occurred. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -431,6 +431,9 @@ w_object(PyObject *v, WFILE *p) | |
| { | ||
| char flag = '\0'; | ||
|
|
||
| if (p->error != WFERR_OK) | ||
| return; | ||
duaneg marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| p->depth++; | ||
|
|
||
| if (p->depth > MAX_MARSHAL_STACK_DEPTH) { | ||
|
|
@@ -750,6 +753,10 @@ PyMarshal_WriteLongToFile(long x, FILE *fp, int version) | |
| w_flush(&wf); | ||
| } | ||
|
|
||
| /* TODO: Contrary to its documentation, this function does NOT set an error on | ||
|
||
| * failure. It is not used internally except from test code, where this doesn't | ||
| * matter, but this discrepancy might cause problems for any external code | ||
| * using it. */ | ||
| void | ||
| PyMarshal_WriteObjectToFile(PyObject *x, FILE *fp, int version) | ||
| { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.