iconv() advances the inbuf pointer; if we decide to realloc and re-iconv,
we need to reset inbuf to the source string
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
{
size_t i_len, o_len, destlen;
size_t retval;
- const char *inbuf = (const char *)src;
+ const char *inbuf = NULL;
char *outbuf = NULL, *ob = NULL;
smb_iconv_t descriptor;
void **dest = (void **)dst;
outbuf = ob;
i_len = srclen;
o_len = destlen;
+ inbuf = (const char *)src;
retval = smb_iconv(descriptor,
&inbuf, &i_len,