Use variable length arrays instead of alloca().
This commit is contained in:
parent
e2e6ec8050
commit
9e3ca39773
3 changed files with 6 additions and 13 deletions
|
|
@ -109,15 +109,13 @@ bool id_h(connection_t *c) {
|
|||
}
|
||||
|
||||
bool send_metakey(connection_t *c) {
|
||||
char *buffer;
|
||||
int len;
|
||||
bool x;
|
||||
|
||||
len = RSA_size(c->rsa_key);
|
||||
int len = RSA_size(c->rsa_key);
|
||||
|
||||
/* Allocate buffers for the meta key */
|
||||
|
||||
buffer = alloca(2 * len + 1);
|
||||
char buffer[2 * len + 1];
|
||||
|
||||
c->outkey = xrealloc(c->outkey, len);
|
||||
|
||||
|
|
@ -287,16 +285,13 @@ bool metakey_h(connection_t *c) {
|
|||
}
|
||||
|
||||
bool send_challenge(connection_t *c) {
|
||||
char *buffer;
|
||||
int len;
|
||||
|
||||
/* CHECKME: what is most reasonable value for len? */
|
||||
|
||||
len = RSA_size(c->rsa_key);
|
||||
int len = RSA_size(c->rsa_key);
|
||||
|
||||
/* Allocate buffers for the challenge */
|
||||
|
||||
buffer = alloca(2 * len + 1);
|
||||
char buffer[2 * len + 1];
|
||||
|
||||
c->hischallenge = xrealloc(c->hischallenge, len);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue