projects
/
tinc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Copy structs from packets to the stack before using them, to prevent
[tinc]
/
src
/
net_setup.c
diff --git
a/src/net_setup.c
b/src/net_setup.c
index
c7c1250
..
c3cfb0f
100644
(file)
--- a/
src/net_setup.c
+++ b/
src/net_setup.c
@@
-17,7
+17,7
@@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: net_setup.c,v 1.1.2.4
2 2003/08/08 22:11:54
guus Exp $
+ $Id: net_setup.c,v 1.1.2.4
4 2003/08/28 21:05:10
guus Exp $
*/
#include "system.h"
*/
#include "system.h"
@@
-182,7
+182,7
@@
bool read_rsa_private_key(void)
return false;
}
return false;
}
- if(s.st_mode & ~0700)
+ if(s.st_mode & ~0
100
700)
logger(LOG_WARNING, _("Warning: insecure file permissions for RSA private key file `%s'!"), fname);
#endif
logger(LOG_WARNING, _("Warning: insecure file permissions for RSA private key file `%s'!"), fname);
#endif
@@
-362,7
+362,7
@@
bool setup_myself(void)
myself->connection->outcipher = EVP_bf_ofb();
myself->connection->outcipher = EVP_bf_ofb();
- myself->key =
(char *)
xmalloc(myself->keylength);
+ myself->key = xmalloc(myself->keylength);
RAND_pseudo_bytes(myself->key, myself->keylength);
if(!get_config_int(lookup_config(config_tree, "KeyExpire"), &keylifetime))
RAND_pseudo_bytes(myself->key, myself->keylength);
if(!get_config_int(lookup_config(config_tree, "KeyExpire"), &keylifetime))
@@
-549,7
+549,7
@@
void close_network_connections(void)
for(node = connection_tree->head; node; node = next) {
next = node->next;
for(node = connection_tree->head; node; node = next) {
next = node->next;
- c =
(connection_t *)
node->data;
+ c = node->data;
if(c->outgoing)
free(c->outgoing->name), free(c->outgoing), c->outgoing = NULL;
if(c->outgoing)
free(c->outgoing->name), free(c->outgoing), c->outgoing = NULL;