X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?a=blobdiff_plain;f=site.c;h=8ef8f5a6e44cea77d7aeef4c0360d7888b5742bb;hb=59230b9b9fc44453f24c6b3cf33a0f4c570a3563;hp=2fafd915b4beeacfa069c9efe8e83f516799bced;hpb=040ee979539e88ef71fb21a80d4a05d24961ae70;p=secnet.git diff --git a/site.c b/site.c index 2fafd91..8ef8f5a 100644 --- a/site.c +++ b/site.c @@ -197,7 +197,7 @@ struct site { static void slog(struct site *st, uint32_t event, cstring_t msg, ...) { va_list ap; - uint8_t buf[240]; + char buf[240]; uint32_t class; va_start(ap,msg); @@ -1266,6 +1266,8 @@ static list_t *site_apply(closure_t *self, struct cloc loc, dict_t *context, sprintf(st->tunname,"%s<->%s",st->localname,st->remotename); /* The information we expect to see in incoming messages of type 1 */ + /* fixme: lots of unchecked overflows here, but the results are only + corrupted packets rather than undefined behaviour */ st->setupsiglen=strlen(st->remotename)+strlen(st->localname)+8; st->setupsig=safe_malloc(st->setupsiglen,"site_apply"); put_uint32(st->setupsig+0,LABEL_MSG1); @@ -1308,7 +1310,6 @@ static list_t *site_apply(closure_t *self, struct cloc loc, dict_t *context, return new_closure(&st->cl); } -init_module site_module; void site_module(dict_t *dict) { add_closure(dict,"site",site_apply);