for(i = 0; envp[i]; i++) {
char *e = strchr(envp[i], '=');
if(e) {
- p = alloca(e - envp[i] + 1);
+ p[e - envp[i] + 1];
strncpy(p, envp[i], e - envp[i]);
p[e - envp[i]] = '\0';
putenv(p);
}
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);
}
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);
}
bool send_ans_key(node_t *to) {
- char *key;
-
// Set key parameters
to->incipher = myself->incipher;
to->inkeylength = myself->inkeylength;
memset(to->late, 0, sizeof(to->late));
// Convert to hexadecimal and send
- key = alloca(2 * to->inkeylength + 1);
+ char key[2 * to->inkeylength + 1];
bin2hex(to->inkey, key, to->inkeylength);
key[to->inkeylength * 2] = '\0';