8000 bpo-43984: Update winreg.SetValueEx to make sure the value set is not -1 by shreyanavigyan · Pull Request #25775 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

bpo-43984: Update winreg.SetValueEx to make sure the value set is not -1 #25775

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

Merged
merged 18 commits into from
Dec 9, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update winreg.c
  • Loading branch information
shreyanavigyan committed May 2, 2021
commit 78417143294ff843d58dd61d1fb7e190227566b5
4 changes: 2 additions & 2 deletions PC/winreg.c
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ Py2Reg(PyObject *value, DWORD typ, BYTE **retDataBuf, DWORD *retDataSize)
else {
DWORD d = PyLong_AsUnsignedLong(value);
if ((d == (DWORD)(-1)) && PyErr_Occurred()) {
free(retDataBuf);
PyMem_Free(retDataBuf);
return FALSE;
}
memcpy(*retDataBuf, &d, sizeof(DWORD));
Expand All @@ -602,7 +602,7 @@ Py2Reg(PyObject *value, DWORD typ, BYTE **retDataBuf, DWORD *retDataSize)
else {
DWORD64 d = PyLong_AsUnsignedLongLong(value);
if ((d == (DWORD64)(-1)) && PyErr_Occurred()) {
free(retDataBuf);
PyMem_Free(retDataBuf);
return FALSE;
}
memcpy(*retDataBuf, &d, sizeof(DWORD64));
Expand Down
0