Fix segfault in init context.
authorSimo Sorce <simo@redhat.com>
Sun, 26 Jan 2014 18:49:04 +0000 (13:49 -0500)
committerSimo Sorce <simo@redhat.com>
Sun, 26 Jan 2014 20:52:37 +0000 (15:52 -0500)
commitecaf387c9c2d1b19259d197bf18c6127896ab03f
tree5d3456f6d2ec2b8617a414e4d4e8bbde97201a9c
parent37c43d36f928bea360cddbff5d330d0b56bc11b2
Fix segfault in init context.

The init context function was improperly initializing the ctx variable (too
late) when some early error conditions can happen. Therefore passing to the
delete context function a random memory address it would then try to free.
This wuld cause a SEGFAULT in most cases.

Additionally unfortunately iconv_close() does not follow good practices and
blindignly dereferences data, even if the passed in pointer is NULL.
So add a check before calling.
src/gss_sec_ctx.c
src/ntlm.c