projects
/
tinc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Move initialization of char *priority up to prevent freeing an uninitialized pointer.
[tinc]
/
src
/
protocol_auth.c
diff --git
a/src/protocol_auth.c
b/src/protocol_auth.c
index
3f4fa01
..
b6018ca
100644
(file)
--- a/
src/protocol_auth.c
+++ b/
src/protocol_auth.c
@@
-109,15
+109,13
@@
bool id_h(connection_t *c) {
}
bool send_metakey(connection_t *c) {
}
bool send_metakey(connection_t *c) {
- char *buffer;
- int len;
bool x;
bool x;
- len = RSA_size(c->rsa_key);
+
int
len = RSA_size(c->rsa_key);
/* Allocate buffers for the meta key */
/* Allocate buffers for the meta key */
-
buffer = alloca(2 * len + 1)
;
+
char buffer[2 * len + 1]
;
c->outkey = xrealloc(c->outkey, len);
c->outkey = xrealloc(c->outkey, len);
@@
-287,16
+285,13
@@
bool metakey_h(connection_t *c) {
}
bool send_challenge(connection_t *c) {
}
bool send_challenge(connection_t *c) {
- char *buffer;
- int len;
-
/* CHECKME: what is most reasonable value for 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 */
/* Allocate buffers for the challenge */
-
buffer = alloca(2 * len + 1)
;
+
char buffer[2 * len + 1]
;
c->hischallenge = xrealloc(c->hischallenge, len);
c->hischallenge = xrealloc(c->hischallenge, len);
@@
-580,7
+575,7
@@
bool ack_h(connection_t *c) {
if(tunnelserver)
send_add_edge(c, c->edge);
else
if(tunnelserver)
send_add_edge(c, c->edge);
else
- send_add_edge(
broadcast
, c->edge);
+ send_add_edge(
everyone
, c->edge);
/* Run MST and SSSP algorithms */
/* Run MST and SSSP algorithms */