projects
/
mod_auth_kerb.cvs
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
e6161bc
)
properly initialize memory space so that it can be unallocated later.
author
kouril
<kouril>
Thu, 18 Dec 2003 15:12:11 +0000
(15:12 +0000)
committer
kouril
<kouril>
Thu, 18 Dec 2003 15:12:11 +0000
(15:12 +0000)
spnegokrb5/accept_sec_context.c
patch
|
blob
|
history
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;