diff options
author | Andreas Schneider <asn@samba.org> | 2014-01-09 15:20:21 +0100 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2014-01-09 22:35:25 +0100 |
commit | bff3ac250e9d4e7d91820eb53c28257aa38fff88 (patch) | |
tree | 54b092e934f4846e2005b02956eb3ccb46062ec8 /source3 | |
parent | 541164d47a86bab90ef96a9be40b8c0997abdd61 (diff) | |
download | samba-bff3ac250e9d4e7d91820eb53c28257aa38fff88.tar.gz samba-bff3ac250e9d4e7d91820eb53c28257aa38fff88.tar.xz samba-bff3ac250e9d4e7d91820eb53c28257aa38fff88.zip |
s3-passdb: Fix string duplication to pointers.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Thu Jan 9 22:35:25 CET 2014 on sn-devel-104
Diffstat (limited to 'source3')
-rw-r--r-- | source3/passdb/py_passdb.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/source3/passdb/py_passdb.c b/source3/passdb/py_passdb.c index 87dbb5dd43..2d3b6371b3 100644 --- a/source3/passdb/py_passdb.c +++ b/source3/passdb/py_passdb.c @@ -2265,8 +2265,18 @@ static PyObject *py_pdb_set_aliasinfo(pytalloc_Object *self, PyObject *args) alias_sid = pytalloc_get_ptr(py_alias_sid); - fstrcpy(alias_info.acct_name, PyString_AsString(PyDict_GetItemString(py_alias_info, "acct_name"))); - fstrcpy(alias_info.acct_desc, PyString_AsString(PyDict_GetItemString(py_alias_info, "acct_desc"))); + alias_info.acct_name = talloc_strdup(frame, PyString_AsString(PyDict_GetItemString(py_alias_info, "acct_name"))); + if (alias_info.acct_name == NULL) { + PyErr_Format(py_pdb_error, "Unable to allocate memory"); + talloc_free(frame); + return NULL; + } + alias_info.acct_desc = talloc_strdup(frame, PyString_AsString(PyDict_GetItemString(py_alias_info, "acct_desc"))); + if (alias_info.acct_desc == NULL) { + PyErr_Format(py_pdb_error, "Unable to allocate memory"); + talloc_free(frame); + return NULL; + } status = methods->set_aliasinfo(methods, alias_sid, &alias_info); if (!NT_STATUS_IS_OK(status)) { |