pidl: Correct string handling to use talloc and be in common
authorAndrew Bartlett <abartlet@samba.org>
Thu, 21 Apr 2016 09:44:56 +0000 (21:44 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Mon, 9 May 2016 23:43:15 +0000 (01:43 +0200)
commitf6c79072ca50e05a68b73a80a0ebd635a9bac068
treeab53473b3bc73a98cb533ed7d4e71716c427c61f
parent9e2c1f72e00cf63da777a515b95ed63139ef2d11
pidl: Correct string handling to use talloc and be in common

The previous string handling assumed the python variables referenced
by PyString_AS_STRING had infinite life.  When they were re-used
the C structure started to point at unexpected things.

We now check correctly for Unicode in every case, and we always
duplicate the string with talloc_strdup()

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
pidl/lib/Parse/Pidl/Samba4/Python.pm