chiark / gitweb /
SECURITY: actually reject messages with improper lengths
[secnet.git] / util.c
diff --git a/util.c b/util.c
index fff5b6d13e5e0f74544723ea4ff9e8f9013634f5..086c23440ffd1fc592495b5235277a9e104f063d 100644 (file)
--- a/util.c
+++ b/util.c
@@ -166,6 +166,7 @@ static const char *phases[NR_PHASES]={
     "PHASE_GETOPTS",
     "PHASE_READCONFIG",
     "PHASE_SETUP",
+    "PHASE_DAEMONIZE",
     "PHASE_GETRESOURCES",
     "PHASE_DROPPRIV",
     "PHASE_RUN",
@@ -268,6 +269,7 @@ void *buf_unappend(struct buffer_if *buf, int32_t amount) {
 
 void *buf_unprepend(struct buffer_if *buf, int32_t amount) {
     void *p;
+    if (buf->size < amount) return 0;
     p=buf->start;
     buf->start+=amount;
     buf->size-=amount;