chiark / gitweb /
site: Initialise st->scratch with SETUP_BUFFER_LEN space.
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 5 Aug 2013 10:45:50 +0000 (11:45 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 5 Aug 2013 10:45:50 +0000 (11:45 +0100)
Otherwise, if we're unlucky, we end up trying to construt a PROD
packet before we have ever used buffer_copy on scratch, which causes
an assertion failure ("buf->size <= buf->len - amount" at util.c:257).

Reported-by: Simon Tatham <anakin@pobox.com>
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
debian/changelog
site.c

index ea1d421c00d2b8c6a4441c5a6339a10d27c674f5..9c7516541487a23270d0161148478dc0b55bff07 100644 (file)
@@ -1,3 +1,10 @@
+secnet (0.3.0~beta3) unstable; urgency=low
+
+  * New upstream version.
+   - Stability bugfix: properly initialise site's scratch buffer.
+
+ --
+
 secnet (0.3.0~beta2) unstable; urgency=low
 
   * New upstream version.
diff --git a/site.c b/site.c
index 0b3923252382af007ba1bafa730151bad04774f0..324a2061682e69188605c04650d6e012d4993624 100644 (file)
--- a/site.c
+++ b/site.c
@@ -1808,7 +1808,7 @@ static list_t *site_apply(closure_t *self, struct cloc loc, dict_t *context,
 
     buffer_new(&st->buffer,SETUP_BUFFER_LEN);
 
-    buffer_new(&st->scratch,0);
+    buffer_new(&st->scratch,SETUP_BUFFER_LEN);
     BUF_ALLOC(&st->scratch,"site:scratch");
 
     /* We are interested in poll(), but only for timeouts. We don't have