projects
/
mod_auth_kerb.cvs
/
.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
properly initialize memory space so that it can be unallocated later.
[mod_auth_kerb.cvs/.git]
/
spnegokrb5
/
accept_sec_context.c
diff --git
a/spnegokrb5/accept_sec_context.c
b/spnegokrb5/accept_sec_context.c
index
9f76695
..
170f55a
100644
(file)
--- a/
spnegokrb5/accept_sec_context.c
+++ b/
spnegokrb5/accept_sec_context.c
@@
-64,8
+64,18
@@
code_NegTokenArg(OM_uint32 *minor_status,
}
} while (ret == ASN1_OVERFLOW);
}
} while (ret == ASN1_OVERFLOW);
- *outbuf = buf + buf_size - buf_len;
+ *outbuf = malloc(buf_len);
+ if (*outbuf == NULL) {
+ *minor_status = ENOMEM;
+ free(buf);
+ return GSS_S_FAILURE;
+ }
+
+ memcpy(*outbuf, buf + buf_size - buf_len, buf_len);
*outbuf_size = buf_len;
*outbuf_size = buf_len;
+
+ free(buf);
+
return GSS_S_COMPLETE;
}
return GSS_S_COMPLETE;
}
@@
-145,7
+155,7
@@
send_accept (OM_uint32 *minor_status,
}
ret = code_NegTokenArg (minor_status, &targ,
}
ret = code_NegTokenArg (minor_status, &targ,
- (unsigned char**) &output_token->value, &output_token->length);
+ (unsigned char
**) &output_token->value, &output_token->length);
free_NegTokenTarg(&targ);
if (ret)
return ret;
free_NegTokenTarg(&targ);
if (ret)
return ret;