mirror of
https://github.com/samba-team/samba.git
synced 2025-07-28 11:42:03 +03:00
Remove level and name fields from dictionary copy in py_to_FORM()
(This used to be commit ac15442579
)
This commit is contained in:
@ -55,16 +55,21 @@ BOOL py_from_FORM_1(PyObject **dict, FORM_1 *form)
|
||||
|
||||
BOOL py_to_FORM(FORM *form, PyObject *dict)
|
||||
{
|
||||
PyObject *obj;
|
||||
PyObject *obj, *dict_copy = PyDict_Copy(dict);
|
||||
char *name;
|
||||
|
||||
if (!to_struct(form, dict, py_FORM))
|
||||
return False;
|
||||
|
||||
if (!(obj = PyDict_GetItemString(dict, "name")) ||
|
||||
!PyString_Check(obj))
|
||||
return False;
|
||||
|
||||
PyDict_DelItemString(dict_copy, "level");
|
||||
PyDict_DelItemString(dict_copy, "name");
|
||||
|
||||
if (!to_struct(form, dict_copy, py_FORM)) {
|
||||
Py_DECREF(dict_copy);
|
||||
return False;
|
||||
}
|
||||
|
||||
name = PyString_AsString(obj);
|
||||
|
||||
init_unistr2(&form->name, name, strlen(name) + 1);
|
||||
|
Reference in New Issue
Block a user